CRhinoApp::RunScript() function returns false


In my c++ plug-in project, I wrote a CRhinoCommand and it correctly works calling it from Rhino command line.

I also call it from a gui button event, using the following syntax and again, it correctly works:
RhinoApp().RunScript(0, L"ChangeStatus Status=Lock", 0);
the function returns true.

I call it from a not member function, which is a callback from an other plug-in (written in c#), using the same syntax shown above, but it doesn’t work;
the RunScript function returns false and the command is not executed (I placed a break-point at its first RunCommand line).

I tried to use CRhinoScriptCommand instead of CRhinoCommand but nothing changed.
I checked the thread id from everywhere but it is always the same one, the UI thread I suppose.

Do you have any advice to solve the problem?
I have no more idea…

Thank you,

Hi @margari,

Without a sample that I can run here, I won’t be able to answer your qustion - sorry.

– Dale

Hello @dale,

thank you for your prompt reply.

I discovered that the c# plug-in lets my c++ callback start from one of its Commands.
I solved adding to the c# command class the following style attributes:

I took a cue from here:

Since my c++ command doesn’t modify the Rhino document, but simply changes the visualization of some of its conduits and toolbars, I hope what I did to be safe.

Thank you again,