Hey there:
A lot of times I find myself with a bunch of objects on different layers and I really want to turn off or lock the layer that a specific object is assigned to.
Back in the dark days when I was in AutoCAD user, there was a command on the toolbar that allowed me to start the command and then select an object in my drawing. Whatever object I picked, it’s layer would be turned off and the object would become invisible.
Could you please tell me if there is a way in Rhino to do the same thing with the tool button or alias command?
Thanks,
Don
There is a script that let’s you select one or more objects, and then it will mark their corresponding layers. The Layers tab must be opened during that time. I don’t remember the name of the script, but probably other users could find it somewhere.
-runscript (
' TurnOffLayerByObject
Dim strObject
strObject = Rhino.GetObject("Pick any object")
If Not IsNull(strObject) Then
Dim srtLayerName
srtLayerName = Rhino.ObjectLayer(strObject)
If Not IsNull(srtLayerName) Then
Rhino.LayerMode srtLayerName , 1
End If
End If
)
Or you can put the following script on a button. Select the objects, click the button and the selected objects’ layers will be turned off. Note that if one of the selected objects is on the current layer, another layer (the most recently added layer that is not in the list to be turned off) will automatically be made current. Also, if you turn off a parent later, the child layers under it will also be automatically turned off.