Jump to content
Sign in to follow this  
Markus Barrera-Kolb

Vectorscript for "Make Guide"?

Recommended Posts

I'd like to be able to use the "Make Guide" command with the keyboard shortcut "G", but simple keystrokes (w/o a modifier) are only available for tools and not menu items, for whatever strange reason. I thought it might be possible to make a tool script that executes this command and then assign that shortcut to it. Can someone enlighten me what the syntax would be for running that command in VectorScript? Thanks!

Share this post


Link to post

Sorry for being no help on a non-modified keystroke for Make Guide but I've been using for years. The forward slash is right above the right command key on macs. I think as important is the unlock command to go with it. A script for an unlocked Make Guides would make sense. I do use for Unlock and for Lock which are directly above the /.

Share this post


Link to post

Create a new "Tool" PIO, paste in the following code.

Next, add it to your workspace and set a keyboard shortcut to the tool.

====================

PROCEDURE Set2Guide;

VAR

x, y : REAL;

h : HANDLE;

BEGIN

DSelectAll;

GetPt(x,y);

h := PickObject(x, y);

IF h <> NIL THEN BEGIN

SetSelect(h);

DoMenuTextByName('Guides',1);

DoMenuTextByName('Unlock',0);

END ELSE SysBeep;

END;

Run(Set2Guide);

Share this post


Link to post

Gerrit , is there a reason why you unlock that Guide? I thought that the purpose of a Guide was that you couldn't move it accidentially?

Share this post


Link to post

My distracted mind must have been merging both Markus' and Henry's requests :-)

Besides, I too like most of my guides unlocked - I move them around constantly.

Share this post


Link to post

Using the "DoMenuTextByName" command I've also made a script for selecting all guides (so that I can assign the shortcut option+G to it). Can something be added to the script so that the command is executed immediately, i.e. doesn't require another mouse-click?

Currently, the script looks like this:

PROCEDURE SelectGuides;

BEGIN

DoMenuTextByName('Guides',2);

END;

RUN (SelectGuides);

Share this post


Link to post

In order to achieve that, you'll need to make a Command instead of a Tool, and add it to the menu's of your workspace (including the keyboard shortcut).

Share this post


Link to post

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.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...