Export macro via RhinoApp.RunScript() does not work

The following line of code in C# has no effect:

RhinoApp.RunScript("_-Export /Users/myuser/export-part.stl ExportFileAs=Binary ExportUnfinishedObjects=Yes _Enter _Enter", true);

However, when I paste

 _-Export /Users/myuser/export-part.stl ExportFileAs=Binary ExportUnfinishedObjects=Yes _Enter _Enter

into the command window in the desktop client it exports the selection in my model into a .stl file. Is this a defect?

I use Rhino for Mac 5.2.2 on OSX 10.11.6

Does this guide help?

http://developer.rhino3d.com/guides/rhinocommon/run_rhino_command_from_plugin/

1 Like

helps indeed. Thank you. I totally forgot that I have to decorate my command classes with

[Rhino.Commands.CommandStyle(Rhino.Commands.Style.ScriptRunner)]