Get `CRhinoCommand::result` if using `CRhinoApp::RunScript`

Hi,

I have a question about CRhinoApp::RunScript. It returns bool, but there no description what it is.

What I actually need is to run another C++ plugin with some parameters specified and somehow figure out if plugin execution failed or not. If it fails, RunCommand of that plugin returns CRhinoCommand::failure but I don’t know if I can somehow catch it with CRhinoApp::RunScript.

I would use CRhinoApp::ExecuteCommand but I believe I don’t have access to setting the parameters for the static object of that plugin class. Or is there a way to set parameters (how would I get the static object which is declared in the plugin main cpp)? I was looking to the description of CRhinoApp::ExecuteCommand

Thanks!

  • Andrey

Hi @pyati,

CRhinoApp::RunScript returns true if the script was successfully queued for running. It does not indicate whether or not the script worked or not.

If you need to know this, then derive a class from CRhinoEventWatcher and override the OnEndCommand virtual function, which include the RhinoCommand::result of the command that finished. Then. just watch for your command.

– Dale

Thanks, Dale! I’ll look into this, it may work for me.

  • Andrey