Jump to content

Execution context lost upon transition from tool back to menu-command

Recommended Posts

When one implements a VS menu-command plug-in and uses either:

1) GetPt or some of its variants

2) CallTool

... pressing ESC, any other key that activates different than the active tool or activating another tool by clicking with the mouse button on it in the given tool palette, causes the menu-command to loose its execution context. The execution of the menu-command is interrupted at the point of the GetPt/GetPt3D/GetPtL/GetPtL3D/CallTool call. CallTool's documentation states that:

After the tool has been used VectorWorks will revert back to the previously active tool.

Probably this is valid only for tool plug-ins.

Here's a sample script:

pt: POINT;

AlrtDialog( 'Pick a location...' );
GetPt( pt.x, pt.y );
       {any code starting from this point does not get executed if ESC or another tool chaning key is pressed or the active tool is changed via a mouse click}
AlrtDialog( concat( 'Location: (', Num2Str( 3, pt.x ), ', ', Num2Str( 3, pt.y ), ')' ) );

Obviously, this is a bug. Is there a way/workaround to go back to menu-command's execution context after changing the desired tool with another one?

Edited by caravanio
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...