Python: How can I create a Layer State?


#1

Hi,

I’m trying to create a new Layer State but the function does seem to exist, it does appear in the documentation but the example is written in VBscript and I cannot find the function in python. Does anyone have any clue as how to implement it?
Here is a screenshot of the help file.

Thanks in advance,

-M


(Dale Fugier) #2

Does this help?

import rhinoscriptsyntax as rs

def TestSaveLayerState():
    plugin = rs.GetPlugInObject("Rhino Bonus Tools")
    if plugin is not None:
        plugin.SaveLayerState("TestLayerState")

if __name__ == "__main__":
    TestSaveLayerState() # Call the function defined above

#3

Hi @dale,

Yes, thank you. It does help.

thanks again,

-M

Ps. It would be nice if the help file would be updated.


(Steve Baer) #4

I’ve added an issue to our bugtracker to add the layer state functions to rhinoscriptsyntax.