rs.Command doesn't work

When I try to use rs.Command() method in a single process script, it work good, but when I try to execute it in a thread, it doesn’t work. Why?

The issue you are facing might be due to the restriction imposed by the Rhino common API, which disallows accessing the Rhino UI components from multiple threads. The rs.Command() method you mentioned involves accessing the Rhino UI, and when executed in a thread, it can cause race conditions and other synchronization issues, which might lead to unexpected behavior.

A solution to this issue would be to run the rs.Command() method in the main UI thread by using the RhinoApp.InvokeOnUiThread() method. This method allows you to execute a delegate in the main UI thread, which ensures that the rs.Command() method is executed properly.

Un saluto

Hi thanks for answering.
Are you shure is it correct? 'cos inside the Rhino Python Editor it doesn’t work

I can’t 'cos I’m writing a plug-in for rhino and I need the python script must be in execution as a separate thread, but the main thread must terminate to obtain again the control of the GUI. If I can use another language, for example Visual Basic or C++, does the problem still remain?