Sub test_sub()
Dim oDoc As Inventor.Document
Set oDoc = ThisApplication.ActiveDocument
Dim oCD As ComponentDefinition
Set oCD = oDoc.ComponentDefinition
Dim i As Integer
Dim oCD2 As ComponentDefinition
For i = 1 To oCD.Occurrences.Count
Set oCD2 = oCD.Occurrences.Item(i).Definition
Debug.Print oCD2.Type
Next
' знаения будут в виде числового кода, см.справку "ObjectTypeEnum"
' например:
' 150995200 - kSheetMetalComponentDefinitionObject
' 83886592 - kPartComponentDefinitionObject
For i = 1 To oCD.Occurrences.Count
Set oCD2 = oCD.Occurrences.Item(i).Definition
If oCD2.Type = kPartComponentDefinitionObject Then
Debug.Print "Деталь"
ElseIf oCD2.Type = kSheetMetalComponentDefinitionObject Then
Debug.Print "Листовой материал"
Else
Debug.Print "Неизвестный тип"
End If
Next
End Sub