Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: Gwennberg

The short answer to your last question is yes.

If 'instances' (SketchedSymbol objects) of the SketchedSymbolDefinition have been placed on any of the drawing's sheets, you can find them by looping through each Sheet, and checking the Sheet.SketchedSymbols.Count first, to see if there area any SketchedSymbols on the sheet, then if there are, you can check further by loop through each SketchedSymbol object in the Sheet.SketchedSymbols collection, checking to see if its SketchedSymbol.Definition property points to the specific SketchedSymbolDefinition you are working with.  Does that make sense to you?

 

To implement this, I would put the code for this part after you have already searched for and found (or copied over) the main SketchedSymbolDefinition object you were initially looking for.  If you did not find the definition object, you will not find any instances, so no need to proceed to look for them.  If the definition was found, then you can proceed to check for placed instances of it using that definition object to compare against any 'instances' of it that may have been placed on any sheets, as mentioned above.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)