Unlike the SelColor command which selects all objects of a certain colour, is it possible to select by colour but only within a selection window?
Any Python hints would be appreciated.
Thanks,
Dan
Unlike the SelColor command which selects all objects of a certain colour, is it possible to select by colour but only within a selection window?
Any Python hints would be appreciated.
Thanks,
Dan
You can use a custom filter for GetObjects
import rhinoscriptsyntax as rs
def color_filter(rhino_object, geometry, component_index):
color = rs.ObjectColor(rhino_object)
# allow for some margin
if color.R > 220 and color.G < 30 and color.B < 30:
return True
return False
rs.GetObjects("get reds", custom_filter = color_filter)
Hi Steve,
I’m aware of the custom filter option for GetObjects, but I believe this is the first time I’ve seen an example of how to use it. Thank you for this. It should prove very useful.
Dan
Yeah, I love this possibility… --Mitch