Greetings!
I can’t seem to get “ExportLayerStates” and “ImportLayerStates” to work, using the help file examples, can anyone tell me how to make it work?
I am trying to use the RhinoScript VB, to save my Layer states for a Layout a view, the code example doesn’t work. (Note, I have the Rhino VB plugin loaded).
I have the python also, but it does not appear to have the store layer state functions that are as advanced as the old VB stuff.
I have two buttons, each with embedded rhino script, my objective is to save the Layers’ (On or Off) State for this or that Layout view page.
NOTE:
I want it to store the state of all the sub-layers also (basically, just the On or Off) visibility condition.
This is the save layers state button code:
! _NoEcho -_Runscript(
Call Main()
Sub Main()
Dim objPlugIn
On Error Resume Next
Set objPlugIn = Rhino.GetPluginObject(“Rhino Bonus Tools”)
If Err Then
MsgBox Err.Description
Rhino.Print "Err getting plugin obj."
Exit Sub
End If
Call objPlugIn.ExportLayerStates(“C:\OverViewLayerStates.lay”)
End Sub
)
// The above is directly from the help files, but, it never saves the above file to the C drive as:
// “OverviewLayerStates.lay” I cannot find the file even with a search all.
// It appears it just does not make this file.
// The above code runs fine in the debugger and does not show an error.
The next code is the Restore layer state embedded in a restore button again from the help file.
! _NoEcho -_Runscript(
Call Main()
Sub Main()
Dim objPlugIn
On Error Resume Next
Set objPlugIn = Rhino.GetPluginObject(“Rhino Bonus Tools”)
If Err Then
MsgBox Err.Description
Rhino.Print "Err getting plugin obj."
Exit Sub
End If
Call objPlugIn.ImportLayerStates(“C:\OverViewLayerStates.lay”)
End Sub
)
//This code runs, even though there is NO file by that name, which I can find, for it to load, and //it does not show a file call error.
Here is what I want to do, let’s say I have 2 layers, Layer one is ON (and all its sublayers), and Layer two is OFF (some of its sublayers are on, some are off)
I hit the “Save Layer State button” it should save the layers in their current condition, and write that state out to a file.
Then I could turn on let’s say, layer 2, and then hit Restore layer state button (user button), it would load the previously, stored state file, and reset the layers to the last saved condition.
Layer 2 should then turn OFF as it was originally stored.
IF this is do-able in python that is ok also, don’t care if it is vb or python, just want it to work.
Thanks in advance,
Scott