Python: How can I create a Layer State?

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.
http://d.pr/i/nMQm

Thanks in advance,

-M

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

Hi @dale,

Yes, thank you. It does help.

thanks again,

-M

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.

1 Like

@stevebaer Any update on this or did I just look in the wrong place? Thanks for adding this if not alreday present.

I don’t believe any layer state functions were added to rhinoscriptsyntax.

1 Like