Vectorworks, Inc Employee Neil Barman Posted December 15, 2010 Vectorworks, Inc Employee Share Posted December 15, 2010 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 Quote Link to comment
Vectorworks, Inc Employee klinzey Posted December 15, 2010 Vectorworks, Inc Employee Share Posted December 15, 2010 Tool require a click in the document in order to be executed. You should create this as a menu command then create a shortcut to the menu command. Quote Link to comment
Vectorworks, Inc Employee Neil Barman Posted December 15, 2010 Author Vectorworks, Inc Employee Share Posted December 15, 2010 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 Quote Link to comment
Pat Stanford Posted December 15, 2010 Share Posted December 15, 2010 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. Quote Link to comment
Vectorworks, Inc Employee Neil Barman Posted December 15, 2010 Author Vectorworks, Inc Employee Share Posted December 15, 2010 Understood. Thank you for the clarification. -Neil Quote Link to comment
Miguel Barrera Posted December 16, 2010 Share Posted December 16, 2010 Why not draw whatever object(s) you need first and then use the custom tool to change the attributes by clicking on the object(s)? Quote Link to comment
Vectorworks, Inc Employee Neil Barman Posted December 16, 2010 Author Vectorworks, Inc Employee Share Posted December 16, 2010 I sometimes do a similar routine with the eye dropper tool, if I'm just drawing something quickly and want to assign it attributes afterwards. Quote Link to comment
maarten. Posted December 17, 2010 Share Posted December 17, 2010 I don't know enough about Events so no idea how to do this, but can't you evoke something like this without clicking in the drawing by double clicking on the pio's icon? That way you can use one key (but you need to hit it twice though). Quote Link to comment
Miguel Barrera Posted December 17, 2010 Share Posted December 17, 2010 As of version 2010, tools cannot respond to events like plug-in objects so you still need to click on the drawing to execute the tool script. Quote Link to comment
JBenghiat Posted December 17, 2010 Share Posted December 17, 2010 If you don't mind some keyboard remapping, you could always assign a function key to the menu command, which would give you a one button shortcut. -Josh Quote Link to comment
Recommended Posts
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.