I am looking for a way to work more efficiently, and many times I need to hide a specific layer. I work with many layers and make2ds and sometimes it gets hard finding that one layer to turn off. Isnt there a way to:
select the object. Select the layer the object is on. Turn off the layer.
Note that simply selecting all objects with same layer attribute and hiding them would not be ideal, the ideal thing would be to turn off the layer
Hi Chris - there is not, that I know of, in plain Rhino but it should be scriptable. I’ll take a look…
Here’s a quick Python:
import scriptcontext as sc
import rhinoscriptsyntax as rs
def HighlightLayers():
ids = rs.SelectedObjects()
if not ids:return
layers = [rs.ObjectLayer(id) for id in ids]
layers = list(set(layers))
for layer in layers:
parent = rs.ParentLayer(layer)
while parent is not None:
rs.ExpandLayer(parent, True)
parent = rs.ParentLayer(parent)
layers = [sc.doc.Layers.FindByFullPath(layer, -1) for layer in layers]
sc.doc.Layers.Select(layers, True)
if __name__ =="__main__":
HighlightLayers()
Oh, I see Clement made something as well - you should be all set. Ah darn, - the script is V6, let me try it in V5… yeah looks like V6 only.