Daryl Wood Posted July 19, 2008 Share Posted July 19, 2008 I have used the "custom/tool attribute" command to create custom tool settings for the "repetitive unit" tool. I have been successful having the command create vectorscript to make the repetitive unit tool active, set the desired class and design layer, but am having difficulty understanding how to get the script to set the correct default file and symbol for the repetitive unit. Have read the "Setting Parameter Values from Scripts" section in the VS Language Guide, but am still confused. I need a simple example to get over this block. In short, I'm looking for a custom tool script to set: -the repetitive unit tool active -the correct class and design layer -all the attributes to "Class Style" -the pitch to a desired value -the symbol catagory and default symbol. Quote Link to comment
Pat Stanford Posted July 20, 2008 Share Posted July 20, 2008 Daryl, Do you want a single use of the tool or to set it and then to leave it active? Do you have any scripting experience other than using the Custom Tool command? Are you willing to go in and edit a script to change the layer and class names and to set the other desired values? If the script changes the defaults for the Repetitive Unit tool, does it need to set them back after running? Do you intend to do multiple versions of the script for different settings? The basic code you need to add to set the PIO default parameters is: SetRField(GetObject('Repetitive Unit'),'Repetitive Unit','__SymbolName','PTSPTS'); Regards, Pat Quote Link to comment
Daryl Wood Posted July 20, 2008 Author Share Posted July 20, 2008 Hello Pat, Answers to your questions: Set the tool and leave it active. Yes on the scripting experience in other languages. Yes I'm comfortable editing the script. No, the script does not need to set the defaults back. Yes, I intend to use the script functionality on numerous tools. Thanks Pat for the SetRField syntax. Part of the problem here is not having good scripting examples for to review and determine how they work. If I could see the scripts for the tools already in VW then lots of my questions could be answered. There are lots of script commands and just knowing what does what seems to be just a trial and error approach which takes more time than I have sometimes. Quote Link to comment
Pat Stanford Posted July 21, 2008 Share Posted July 21, 2008 Daryl, I wrote kind of a script prototype and posted it in the script sharing forum here: http://techboard.vectorworks.net/ubbthreads/ubbthreads.php?ubb=showthreaded&Number=106965#Post106965 Take a look and let me know what you think. Regards, Pat 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.