Layer states and GetPlugInObject()

I was looking to try something with layer states. In the script help, I found the section on layer states with 9 methods. The layer state manager in V5 depends on the plug-in “Rhino Bonus Tools”. On the Help page, there is a small example script:

Sub TestLayerStates
  Dim objPlugIn
  On Error Resume Next
  Set objPlugIn = Rhino.GetPluginObject("Rhino Bonus Tools")
  If Err Then
    MsgBox Err.Description
    Exit Sub
  End If
  'TODO: call a layer state method...
End Sub 

First of all, the above was copied out of the Python rhinoscriptsyntax help, so it is evidently wrong - needs to be “translated” to Python from vbscript. However, that’s the minor problem. The major problem is it doesn’t work in either vbscript or python.

I found this issue in youtrack which shows how to make it work with Python/RhinoCommon. the Help still needs to be fixed, and I guess the Rhinoscript/Python methods either removed or made to work…

import Rhino
plugin = Rhino.RhinoApp.GetPlugInObject("Rhino Bonus Tools")

Now my question is this : how do I get the commands/methods associated with the plug-in? I can see them in Rhino’s plug-in manager, how to get them in a script? Also, for example the LayerStateManager has a bunch of methods and those do not show up… How do I find those?

Thanks,
–Mitch

These are the methods available for layer state management.

http://4.rhino3d.com/5/rhinoscript/layer_state_methods/layer_state_methods.htm

Does this help?