- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey All,
Trying to do something I thought would be simple, but I have having some trouble. I need to see what the user has entered for values in a sketched symbol. I thought I could just iterate through the attributes, but I get an error saying "Object doesn't support this property or method" on the line For Each oAttrib In oSketchedSymbol.oAttribSets.
Here is the whole code...
Public Function GetAttributes(SymbolName As String) As Boolean
'This function returns true when SymbolName is inserted into the drawing
invApp = GetObject(, "Inventor.Application")
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet
Dim oSketchedSymbol As SketchedSymbol
Dim AttSet As AttributeSet
For Each oSketchedSymbol In oSheet.SketchedSymbols
If oSketchedSymbol.Name = SymbolName Then
Dim oAttrib As Inventor.Attribute
For Each oAttrib In oSketchedSymbol.oAttribSets
MsgBox (oAttrib.Value)
Next
End If
Next
End Function
Master Drafter/ CAD Programmer
Using Inventor 2018
Solved! Go to Solution.