Hi All,
I know this might be easy but I don’t know how to do it, and I didn’t find anything in the group.
When I’m stitching a lot of surfaces I like to change the display color to green when they are OK.
I usually go to properties and choose the color, but I would like a shortcut or a green button in my popup, can anybody help me?
Once I have one made I will probably create other colors.
I have this:
"""Changes selected objects' colors to a fixed color (argument)
Script by Mitch Heynick 15.12.18"""
import rhinoscriptsyntax as rs
def MakeColor(color):
block_count=0
selected=rs.GetObjects("Select objects to apply color",preselect=True)
if selected:
objs=[]
for obj in selected:
if rs.IsBlockInstance(obj): block_count+=1
else: objs.append(obj)
if objs:
rs.EnableRedraw(False)
rs.ObjectColor(objs,color)
#rs.UnselectAllObjects()
rs.Redraw()
msg2="{} block instances found - explode before changing color!"
if block_count: rs.MessageBox(msg2.format(block_count))
MakeColor(rs.coercecolor([0,255,0])) #change color argument as needed
It only works on discreet objects, not sub-selected faces of polysurfaces. (I might be able to modify that) Just change the 3 numbers in the last line to any other RGB color you want.
1 Like
Thanks Mitch! it works perfectly