Replace Sketch Symbol retain reference to attached entity

Replace Sketch Symbol retain reference to attached entity

Anonymous
Not applicable
389 Views
1 Reply
Message 1 of 2

Replace Sketch Symbol retain reference to attached entity

Anonymous
Not applicable

Hello,

 

I am writing a quick program that replaces a sketch symbol in a drawing. I am able to query the old symbol's position and use that however, the old symbol is attached to a leader note via geometry intent. How can I query the leader note from the old symbol so I can recreate the intent and have the new symbol attach to the same leader note? 

 

Any help appreciated. Let me know if more information is needed. 

-Chris

0 Likes
Accepted solutions (1)
390 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Figured it out. Posting for reference.

 

//returns the GeometryIntent of the node, in this case it is the node @ index 2 (this is where I was confused since I was using index @1 but this returns the first node of your leader which is not what is attached to the leader note mentioned above)

object intent = oldSymbol.Leader.AllNodes[2].AttachedEntity;

 

Once the object was returned I used that as a point in my new sketchsymbol to insert it and the new symbol is attached to the intent