Select by colour - ruby?
-
hello,
i use the SELECTOR for selection by geometrydoes anybody know a ruby for SELECTION BY COLOUR ?
thanx stan
-
You can rightclick on a color in the material browser to get a select option...
-
It's built into the Materials Browser context-menus, but that only selects faces in the current active context that use the chosen material, ignoring any groups, instances, edges, text etc using the material.
This one-liner copy/pasted+<enter> in the Ruby Console will select everything using the material specified by name - edit the 'mname=' to suit the material you seek...
mname="Material1";m=Sketchup.active_model;s=m.selection;s.clear;m.active_entities.each{|e|s.add(e)if e.respond_to?(;material) && e.material && e.material.display_name==mname}
Advertisement