Jump to content

Custom tool script


Recommended Posts

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.

Link to comment

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

Link to comment

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.

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