04-30-2020
11:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-30-2020
11:05 AM
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, ) ']