Jump to content
DCarpenter

changing symbol name

Recommended Posts

Writing a simple script to add a prefix to all the symbol names in the drawing but can't seem to find the command to replace the current name with a new name.  I can get a handle to each symbol in the drawing and its name, but can't figure out the command to write a new name for the symbol?  thoughts?

 

H1:=FInSymDef(H1);   {will get me the handle to the first symbol in the drawing}

SymName:=GetSDName(H1);     {will get me the current name of the symbol}

 

current symbol name:  "Toilet"

symbol name after the script is run:  "Toilet-1"
 

Share this post


Link to post

I think you would need to use GetSymbolOptionsN() then SetSymbolOptionsN(), loading the latter with the values from the former, except for the symbol name.

Share this post


Link to post

Hi Dave,

   Use SetName().

 

   If you have a symbol named 'Bob', the following will change the symbol's name to 'Larry', where 'H' is a variable of type HANDLE;

 

H := GetObject('Bob');
SetName(H, 'Larry');
 

HTH,

Raymond

  • Like 1

Share this post


Link to post

SetName() and the Batch Rename tool are exactly what i needed. I remembered seeing that batch rename tool in the highlight reel for 2020 but could never figure out where it was.  I kept on looking for it in the Organization window for layers and classes, but now that i know where it is, it's like a whole new day!

 

Thank you for your help,

Dave

 

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...