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

Hi @Anonymous 

 

Give this a try.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

'this is the name of the symbol library file,
'the path to this location is specified under 
'Tools tab > Application Options button > Files tab 
oSymbolDrawingName = "Sketched Symbols"


'check file type 
If ThisDoc.Document.DocumentType <> kDrawingDocumentObject Then
Return
End If

'define the drawing document
Dim oDrawDoc As DrawingDocument 
oDrawDoc = ThisApplication.ActiveDocument

Dim oSketchSymLib As SketchedSymbolDefinitionLibrary
oSketchSymLib = oDrawDoc.SketchedSymbolDefinitions.SketchedSymbolDefinitionLibraries.Item(oSymbolDrawingName)

Dim oSymbolList As New ArrayList

For Each oSymbolDef In oSketchSymLib.SketchedSymbolDefinitions
	oSymbolList.Add(oSymbolDef.name)
Next

oName = InputListBox("Pick a Symbol",oSymbolList, oSymbolList(0), "iLogic", "List of Symbols")

If oName = "" Then
	Return 'exit rule
End If

Dim oSymDef As SketchedSymbolDefinition

'place the symbol in the Drawing Resources folder
oSymDef = oDrawDoc.SketchedSymbolDefinitions.AddFromLibrary(oSketchSymLib, oName, True)


Dim oPosition As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(10, 15)

'[use this if the symbol has no prompted entry
Dim oSymbol As SketchedSymbol
oSymbol = oDrawDoc.ActiveSheet.SketchedSymbols.Add(oSymDef, oPosition, 0, 1, )
']