Jump to content
Developer Wiki and Function Reference Links ×

Edit existing symbol


Recommended Posts

If I have a plug-in that uses a symbol with a known name and I want to edit the symbol, how do I go about that?

 

Let's say I have a button in the OIP and when the user presses it I want it to add a rectangle on top of the existing 2D geometry.

Link to comment

I was never able to get the EditObjectSpecial command to work on editing a Symbol, just editing the path or profile groups of PIOs.  But @JBenghiat shared a wonderful nugget of information that can get you into the edit mode of any requisite object (Symbol Definition, Viewport annotation group, Group, etc).  The only trick is that it will not launch the Edit Component widget that you would traditionally get when editing Symbols.

 

The key is SetObjectVariableInt(<handle to object>,9743,0);  It's not in any formal VS documentation.  Passing in a 0 will get the 2D edit, I believe it follows the standard projection numbering for 3D edits, I typically use 7 for 3D edits. 

Link to comment

What I shared should take you directly to the edit container of the passed in object.  So if you pass in a handle to the Symbol Definition, it will go into the Symbol Edit for the definition.  For your PIO, are you creating a copy of the Symbol geometry in the PIO or placing the Symbol directly?  When you say you want a button to add a rectangle to the Symbol, do you want it to be unique to that PIO or to add the rectangle to the actual Symbol Definition, thereby changing every instance using that Symbol Definition?

Link to comment

To add to @Jesse Cogswell’s questions, the easiest approach is to edit the symbol programmatically, so if the user actions are limited, you can just add to the symbol definition. For example, draw a rectangle in the drawing with a custom tool, then add the rectangle to the symbol definition, translating world coordinates to the symbol’s coordinates. 
if it’s free editing, the Vectorworks approach is to provide a shortcut for selecting the symbol in the Resource Manager. 
 

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