Python: How can I create a Layer State?


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,


Does this help?

import rhinoscriptsyntax as rs

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

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

Hi @dale,

Yes, thank you. It does help.

thanks again,


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

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