michaelk Posted April 11 Share Posted April 11 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. Quote Link to comment
Pat Stanford Posted April 11 Share Posted April 11 Get a handle from the name and then use EditObjectSpecial? Probably need to make sure to reset the PIO after the change. And I know you know that this will likely change all instances that use that symbol., At least on the next PIO regen. Quote Link to comment
Jesse Cogswell Posted April 11 Share Posted April 11 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. Quote Link to comment
michaelk Posted April 11 Author Share Posted April 11 Thanks Jesse! Are you able to do actual edits? I'm finding that I need to nuke everything in the symbol and recreate it. Quote Link to comment
Jesse Cogswell Posted April 11 Share Posted April 11 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? Quote Link to comment
JBenghiat Posted April 11 Share Posted April 11 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. 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.