Jump to content

Tool Selection in Contextual Menu


Recommended Posts

I haven't done it, but it should be possible. Yes, you will have to write a script, a VSM Vectorscript Menu item to be exact. You would use the VectorScript Plug-In Editor under Scripts in the Tools menu.

OK, I take that back. I have done it now.

Go into the VS PIug-In Editor and create a new Command (top radio button). Click the Script Button and enter the following script

SetTool(-205);

Click OK twice.

Edit you workspace to include the command in the contextual menu.

The -205 is the number for the oval tool. All the other tool numbers are listed in the VectorScript Appendix. Go into the VectorWorks Help. Select the VectorScript Function Reference. Click on the link in the right hand pane to open the function reference.

In the upper left pane, click on Additional Resources. In the lower left pane, click on the VectorScript Appendix. Bookmark this page so you can get back to it. Under Appendix E, click on the SetTool-CallTool Selectors.

If you are going to do many of these, I recommend that you make a category so you can find them more easily in the Workspace editor. Also, you might want to start the names with a space or an exclaimation mark so they sort to the top of the list.

Pat

Link to comment

It looks like there is another command

SetToolByName('2D Selection Tool');

That will give you all of the tools that don't have numbers.

There is also a similar CallToolByName that just activates the tool for one use (like Call Tool)

These "hidden" functions are listed on the on-line function reference

Pat

Link to comment

Thanks Thanks thanks Pat! This works:

PROCEDURE 2DTool;

BEGIN

Message(SetToolByName('2D Selection Tool'));

END;

RUN(2DTool);

Last question: is there a different command that I can use instead of message so that the vectorscript window is not called up? It doesn't work without it though.

Link to comment

I will never figure out why they make some of these things functions instead of procedures. Functions return a value, procedures don't. Try this instead. It includes a variable to assign the return value of the function to.

Procedure Test;

Var B1:Boolean;

Begin

B1:=SetToolByName('Spiral');

end;

Run(Test);

Also, note that this seems to only work for items that don't have standard SetTool IDs. You will probably need two versions depending on what tools you want to access.

Pat

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.

Guest
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...