michaelk Posted September 6, 2015 Share Posted September 6, 2015 Can someone point me in the right direction? I have a script that successfully Creates a record format Creates a symbol folder Creates a symbol Attaches the record format to the symbol Now I'd like to change the values in the fields attached to a symbol. (Eventually, several symbols will use this record format.) The symbol has not been inserted into the drawing. I want to change the values in the symbol definition. SetRField(symbolHand, nameOfRecordFormat, nameOfField,'This is a test'); doesn't seem to do it. Is this possible? Do I need to create a different record format with default values for each symbol? Any ideas? Thanks! mk Quote Link to comment
Hippocode Posted September 6, 2015 Share Posted September 6, 2015 You need to make sure that symbol hand is a handle to the symbol definition, not a symbol. Quote Link to comment
michaelk Posted September 7, 2015 Author Share Posted September 7, 2015 How can I make sure? The symbol is not inserted into the drawing. I'm capturing the handle to the symbol with a GetObject immediately after the symbol is created. symbolHand := GetObject(nameOfSymbol); Even after SetRField(symbolHand, nameOfRecordFormat, nameOfField,'This is a test'); the symbol definition still has the default record format values. thanks mk Quote Link to comment
michaelk Posted September 7, 2015 Author Share Posted September 7, 2015 Nevermind! Got it to work! Thanks mk Quote Link to comment
David Poiron Posted August 17, 2021 Share Posted August 17, 2021 How did you get this to work? I am looking for a way to get a handle on a symbol definition (based on its name or a value in its record format) and then change the values of other fields in that format. Quote Link to comment
Hippocode Posted August 17, 2021 Share Posted August 17, 2021 https://developer.vectorworks.net/index.php/VS:GetObject Since the symbol definition is unique you can get the handle using its name. Be sure to verify the object type. 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.