C#, How to stop Command from executing by checking the conditions in Command.BeginCommand?

rhino
rhinocommon
rhino5

#1

Hello!

I’m currently having a requirement that require me to check the current condition before executing new Command. So what I’m trying to do now is to have the condition checks in “Command.BeginCommand” event and if it does not meet the condition, do not execute the Command.

However the problem is, in “Command.BeginCommand” does not have any return values to indicate if the command is to be canceled. Are there any other ways to achieve this without needing to implement the checks in every commands class?


(Dale Fugier) #2

This this for one of your commands or any command?

If the user starts a command, there is no good/easy way of canceling it’s execution from a plug-in.

– Dale


#3

It is for any commands, so does it mean there is still a way to make it possible?


(Dale Fugier) #4

Sorry, no.


#5

Thanks for the clarification! :slight_smile: