Last active
December 11, 2015 21:18
-
-
Save yasushisakai/4660841 to your computer and use it in GitHub Desktop.
VERY VERY simple script to change the current layer to the selected object.
I run this as a command and set "CL" as an alias. Maybe there is the same built-in command...similar I found was "ChangeToCurrentLayer",which changes the object's layer to the current layer. be sure to save this to the folder that rhino searches when opening.(Rhinoceros/…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rhinoscript.userinterface | |
import rhinoscript.geometry | |
import rhinoscriptsyntax as rs | |
__commandname__ = "CurrentLayer" | |
def RunCommand( is_interactive ): | |
''' | |
CurrentLayer: | |
changes the current layer to the same as the selected objects layer. | |
''' | |
obj = rs.GetObject('select object to change current Layer',preselect=True,select=False) | |
if obj==None: | |
return 1 | |
objLayer = rs.ObjectLayer(obj) | |
rs.CurrentLayer(objLayer) | |
return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment