Issue with RunScript in Rhino6

Hello,

I’m having an issue with my plugin.
It was working in Rhino 5 but not anymmore.

I needed to get the list of LayerStates that are saved so I used the command _-LayerStateManager to export them to a temporary file ; then read that file to generate a list of LayerState in my program.

Calling _-LayerStateManager Export <some_path> _Enter works fine when using the command panel in Rhinoceros, but it doesn’t do anything (anymore) when called from my plugin.
The method Rhino.RhinoApp.RunScript returns false all the time, and my temporary file remains empty …

Am I missing something ?
Have things changed since Rhino 5 regarding script execution ?

Thanks,
Alexandre

Hi @Alexandre_Beaudet,

Is your plug-in command, that is scripting the LayerStateManager command a script runner command?

– Dale

Hi,

The LayerStateManager command can either be called by a plugin command with a ScriptRunner attribute, or from the UI (winform).
In both cases, it doesn’t work

Heh, I was looking at the wrong command :expressionless: the one I was calling did not specify the ScriptRunner attribute …
For the UI, I think it may be related to the script failing, or files being locked because of it … The error seems to be coming from my code :slight_smile:

Thanks, and sorry !