Hi Bravlin, the Esc key doesn't run any command directly, it runs a chunk of code in the keyboard handler that's part of the core C++ code in moi_lib.dll . It doesn't just cancel a command, it goes through a sequence of potential actions like if there is a flyout menu active or a dialog window has focus it will close that, otherwise if a selection filter is active it will clear that, otherwise if a command is running it will start the cancel process for that, otherwise if any waitable object like a point picker or object picker is active it will raise a cancel event on that, otherwise if any objects are selected it will deselect those, otherwise if there is any selection lock it will clear that, otherwise if any points on objects are on it will turn those off.
If you want to cancel a current running command by script there is an access point to trigger that using moi.command.cancel(); That will not immediately cancel the command it will set a flag to initiate the canceling process, the actual command will end later after it gets a little bit of time to handle it.
- Michael
|