Jump to content
Developer Wiki and Function Reference Links ×

Script that can change it's own default parameters


Recommended Posts

Hey,

I'm using a script to number certain symbols (A1,A2,A3).

This is done by adding the right name in a popup which will be assigned to the selected symbol(s).

It would be nice to show the previous name + 1 as default in the popup for the next symbols....

I havn't found a way to alter the default value in the same script.

The best way around that I know would be to make a custom special symbol just to hold the name in a Rfield and retrieve/change it each time ?

XML also looks like an option, but I'd need to reset it for each new drawing..

Edited by hippothamus
Link to comment
  • Vectorworks, Inc Employee

If it's just a document script you can use GetSavedSetting/SetSavedSetting to store the values. This will save the values per machine. You could also manually create a record and save the values to the record.

If you make it a menu command, then the menu command can have parameters and you can store the values in the default record for the command. This will let you save the values on a document by document basis.

Link to comment

If you make it a menu command, then the menu command can have parameters and you can store the values in the default record for the command. This will let you save the values on a document by document basis.

That works perfect.

Though I did have problems retrieving the values at first, the script didn't recognize the field values as integers(parameter setup) but as text instead.

str2Num etc saved me :)

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