Jump to content
Developer Wiki and Function Reference Links ×

Making a "pen color, weight" Tool


Neil Barman

Recommended Posts

  • Vectorworks, Inc Employee

Hello,

I am a longtime VW user but have not done very much with VS so far.

I am trying to make a Tool, to put in a palette (and eventually give it a keyboard shortcut), of a little custom script that I've used for years in a script palette (but has always of course lacked keyboard shortcuts). The little script, when double-clicked, quickly changes the pen colour, weight, etc. I have a few of these scripts for when I'm not drawing in a Class.

Here's an example of one of these scripts:

-------------

Procedure CustTool;

VAR

Name:STRING;

Result:BOOLEAN;

BEGIN

FillFore(255);

PenFore(213);

PenSize(79);

END;

Run(CustTool);

-------------

This script has worked well for any line, circle, polygon, etc. However, when I made a Tool using this script (and put it in a palette and such), clicking on that tool doesn't have the same effect. The Tool button can be pressed, but then when I choose to draw a line, circle, etc the pen colour, size are not what the script should have told them to be (basically, they don't change as they are supposed to).

So, am I trying to do something that isn't possible (that is, asking a tool script to only set pen colour, size etc without telling it to also draw a line, circle, polygon, etc)?

Or am I just missing a bit of script that will do what I am looking to do?

Thanks,

-Neil

Link to comment
  • Vectorworks, Inc Employee

So, if I read you correctly, I can't activate a Tool, then choose another Tool (ie. Line) then click in a drawing?

I had originally created menu commands for the scripts, but I can't get one key shortcuts with those, which is what I am my staff would very much appreciate. However, if what I'm trying to do simply can't be done using VS, then I would imagine they could live with "chorded" shortcuts.

-Neil

Link to comment

Correct.

So, if I read you correctly, I can't activate a Tool, then choose another Tool (ie. Line) then click in a drawing?

Correct. We had several long discussions on the list last year regarding this and it can not be done.

VS Tools require a click in the drawing to "run" the script.

VS Commands require only a keystroke or mouse click to "run" the script.

You will have to decide if you prefer to click on the tool, click on the drawing then click on the other tool, or to use a keystroke with a modifier to run the command.

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