def InCommand(ignore_runners=True): """Determines if Rhino is currently running a command. Because Rhino allows for transparent commands (commands run from inside of other commands), this method returns the total number of active commands. Parameters: ignore_runners [opt] = If true, script running commands, such as LoadScript, RunScript, and ReadCommandFile will not counted. Returns: the number of active commands """ ids = rhcommand.GetCommandStack() return len(ids)
def InCommand(ignore_runners=True): """Determines if Rhino is currently running a command. Because Rhino allows for transparent commands (commands run from inside of other commands), this method returns the total number of active commands. Parameters: ignore_runners [opt] = If true, script running commands, such as LoadScript, RunScript, and ReadCommandFile will not counted. Returns: the number of active commands Example: import rhinoscriptsyntax as rs commands = rs.InCommand() if commands > 0: print "Rhino is running", commands, "command(s)." else: print "Rhino is not running any command(s)." See Also: Command IsCommand """ ids = rhcommand.GetCommandStack() return len(ids)