Clear previous command when another command is clicked

Hi,

I click a command and it prompts to select a mesh.
without selecting the mesh, another command is clicked to select a point.
the previous command is not cancelled rather the other command is along the select mesh prompt.

_Command: MeshCommand
_Select mesh: PointCommand
Select point:

whereas the rhino commands work as expected.

_Command: MeshSplit
Select objects to split:
_Command: MeshTrim
Select cutting objects:

what am i missing to do?

Are you running the command “Mesh”? This command will ask for surfaces or polysurfaces to create meshes from.

No.

Its my own command…

The ! character cancels any running command (like hitting esc.) --Mitch

1 Like

thanks for that… just tried it out…

it works if the previous command has GetMultiple()
if the previous command has Get(), the command is not cancelled :frowning:

Any idea??

How are you running your script? ! _-RunPythonScript .... should cancel anything running previously. --Mitch

figured it out…

defining the command style as ScriptRunner does not cancel that command even with ! mark…
[Rhino.Commands.CommandStyle(Rhino.Commands.Style.ScriptRunner)]

Removing it worked as expected

Not here, tested with V5 and V6 the scripts where started like this from a button:

! _-RunPythonScript MyScript.py

I think this might be a bug. My test script just asks for a point to pick using rs.GetPoint(). If i hit the button 3 times without picking a point, the script is run 3 times.

_
c.