By adamwade
#386818
Hey JD,

I've had trouble using the old code you wrote for randomizing Object ID colors. I'm in Rhino 5 (64bit) now and I can't seam to create a button that functions properly. Can you assist please (or anyone else)?

Thanks

Here is the original code you wrote that worked in Rhino 4:

_NoEcho
-_RunScript (
Dim obj, key, r, g, b
key = "MWR_OBJIDCOLOR"
obj = Rhino.FirstObject
While Not IsNull(obj)
r = "255:" & Cstr(Int(Rnd * 256))
g = ":" & Cstr(Int(Rnd * 256))
b = ":" & Cstr(Int(Rnd * 256))
Rhino.SetUserText obj, key, r & g & b
obj = Rhino.NextObject(obj)
Wend
Rhino.Print "Done Randomizing Maxwell Object IDs."
)
Chocolate test with SSS

nice