Hello
And what kind of infomation did you try to access? If you can't give detailed information, the only solution would be that you strip your code down to the failing part by yourself until you found it or enclose your failing part code in a try-catch statement to suppress the error messages.
As an example i traverse through the structured BOM view, get item number, quantity and two iProps for each row and write it to the iLogic logger. Even if there are promoted parts in the BOM view, no error is raised. Can you confirm that with your assembly or is it failing also?
Sub Main()
BOMDemo()
End Sub
Private Sub BOMDemo()
'Makro assumes:
'- an assemblydocument is open
'- the structured BOM view is activated
Dim oApp As Inventor.Application
oApp = ThisApplication
Dim oAssDoc As AssemblyDocument
oAssDoc = oApp.ActiveDocument
Dim oBOM As BOM
oBOM = oAssDoc.ComponentDefinition.BOM
oBOM.StructuredViewEnabled = True
Dim oBOMView As BOMView
For Each oBOMView In oBOM.BOMViews
If oBOMView.ViewType = BOMViewTypeEnum.kStructuredBOMViewType Then Exit For
Next
If oBOMView Is Nothing
MsgBox("BOMView not found", , "iLogic")
Exit Sub
End If
Dim oBOMRow As BOMRow
'BOM headline
Logger.Info("Item | Quantity | Part Number | Description")
Logger.Info("-------------------------------------------")
'read all BOM rows
For Each oBOMRow In oBOMView.BOMRows
Logger.Info(" " & oBOMRow.ItemNumber & " | " & oBOMRow.ItemQuantity & " | " & oBOMRow.ComponentDefinitions.Item(1).Document.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").Item("Part Number").Value & " | " & oBOMRow.ComponentDefinitions.Item(1).Document.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").Item("Description").Value)
If oBOMRow.ChildRows IsNot Nothing Then TraverseBOM(oBOMRow.ChildRows)
Next
End Sub
Private Sub TraverseBOM(oBOMRows As BOMRowsEnumerator)
Dim oBomRow As BOMRow
For Each oBomRow In oBOMRows
Logger.Info(" " & oBomRow.ItemNumber & " | " & oBomRow.ItemQuantity & " | " & oBomRow.ComponentDefinitions.Item(1).Document.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").Item("Part Number").Value & " | " & oBomRow.ComponentDefinitions.Item(1).Document.PropertySets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}").Item("Description").Value)
If oBOMRow.ChildRows IsNot Nothing Then TraverseBOM(oBOMRow.ChildRows)
Next
End Sub
R. Krieg
RKW Solutions
www.rkw-solutions.com