Check if command is running

I made a command that does some tasks.

I need check if this command is runing or not, there some way?

like:

RhinoApp.RunScript("_-Custom",true);

If (command (_-Custom== true)
{
messagebos.show(“Command is running”);
}

:slight_smile:

Hi @MatrixRatrix
See the EndCommand event in the sample https://github.com/mcneel/rhino-developer-samples/blob/6/rhinocommon/cs/SampleCsEventWatcher/SampleCsEventHandlers.cs

There are several static functions on the Command class in RhinoCommon to check active command and the command stack.

You probably want
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Commands_Command_InCommand.htm

or

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Commands_Command_GetCommandStack.htm

Thank you.