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 ,

 

If your Tools > application options > Files > Symbol Library path is specifying the server path, then you could use something like this.

 

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"

'This is the name of the symbol to place
oSymbolName = "Test101"

'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 oSymDef As SketchedSymbolDefinition

'place the symbol in the Drawing Resources folder
oSymDef = oDrawDoc.SketchedSymbolDefinitions.AddFromLibrary(oSketchSymLib, oSymbolName, 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, )
']

''or
''[ use this if the symbol has prompted entry
'Dim sPromptStrings(2) As String 'string array with 2 items, for two prompts
'sPromptStrings(0) = "Hello"
'sPromptStrings(1) = "World"


'Dim oSymbol As SketchedSymbol
'oSymbol = oDrawDoc.ActiveSheet.SketchedSymbols.Add(oSymDef, oPosition, 0, 1, sPromptStrings)