import random
import scriptcontext
import rhinoscriptsyntax as rs

def RandomObjectColor():
    """ assign a random object wireframe color to selected objects"""
    
    f = 1 + 2 + 4 + 8 + 16 + 32 + 256 + 512 + 4096 + 8192 + 1073741824
    obj_ids = rs.GetObjects("Select objects to color", f, True, True, True)
    if not obj_ids: return
    
    r = random.randint(0,255)
    g = random.randint(0,255)
    b = random.randint(0,255)

    rs.ObjectColor(obj_ids, color = (r,g,b))
    scriptcontext.doc.Views.Redraw()

RandomObjectColor()