ok more info.. i have managed to adapt a macro now that seems to grab the info and another that can dump it into a notepad text file with separations so i can import it into excel. Dumping direct into excel is along the line..
macro is as follows
Private Sub QueryBOMRowProperties(oBOMRows As BOMRowsEnumerator, ItemTab As Long)
ItemTab = ItemTab + 3
' Iterate through the contents of the BOM Rows.
Dim i As Long
For i = 1 To oBOMRows.Count
' Get the current row.
Dim oRow As BOMRow
Set oRow = oBOMRows.Item(i)
'Set a reference to the primary ComponentDefinition of the row
Dim oCompDef As ComponentDefinition
Set oCompDef = oRow.ComponentDefinitions.Item(1)
Dim oPartNumProperty As Property
Dim oDescripProperty As Property
Dim oMaterialProperty As Property
Dim oRevProperty As Property
Dim oCommentsProperty As Property
If TypeOf oCompDef Is VirtualComponentDefinition Then
'Get the file property that contains the "Part Number"
'The file property is obtained from the virtual component definition
Set oPartNumProperty = oCompDef.PropertySets.Item("Design Tracking Properties").Item("Part Number")
'Get the file property that contains the "Description"
Set oDescripProperty = oCompDef.PropertySets.Item("Design Tracking Properties").Item("Description")
'Get the file property that contains the "Material"
Set oMaterialProperty = oCompDef.PropertySets.Item("Design Tracking Properties").Item("Material")
'Get the file property that contains the "Document Revision"
Set oRevProperty = oCompDef.Document.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kRevisionSummaryInformation)
'Get the file property that contains the "Comments"
Set oCommentsProperty = oCompDef.Document.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kCommentsSummaryInformation)
Print #1, Tab(ItemTab); oRow.ItemNumber; "\"; oRow.ItemQuantity; "\"; oPartNumProperty.Value; "\"; oDescripProperty.Value; "\"; oMaterialProperty.Value; "\"; oRevProperty.Value; "\"; oCommentsProperty.Value;
Else
'Get the file property that contains the "Part Number"
'The file property is obtained from the parent
'document of the associated ComponentDefinition.
Set oPartNumProperty = oCompDef.Document.PropertySets.Item("Design Tracking Properties").Item("Part Number")
'Get the file property that contains the "Description"
Set oDescripProperty = oCompDef.Document.PropertySets.Item("Design Tracking Properties").Item("Description")
'Get the file property that contains the "Material"
Set oMaterialProperty = oCompDef.Document.PropertySets.Item("Design Tracking Properties").Item("Material")
'Get the file property that contains the "Document Revision"
Set oRevProperty = oCompDef.Document.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kRevisionSummaryInformation)
'Get the file property that contains the "Comments"
Set oCommentsProperty = oCompDef.Document.PropertySets.Item("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}").ItemByPropId(kCommentsSummaryInformation)
Print #1, Tab(ItemTab); oRow.ItemNumber; "\"; oRow.ItemQuantity; "\"; oPartNumProperty.Value; "\"; oDescripProperty.Value; "\"; oMaterialProperty.Value; "\"; oRevProperty.Value; "\"; oCommentsProperty.Value;
'Recursively iterate child rows if present.
If Not oRow.ChildRows Is Nothing Then
Call QueryBOMRowProperties(oRow.ChildRows, ItemTab)
End If
End If
Next
ItemTab = ItemTab - 3
End Sub
now i want to add the following but cant work out how? component type, BOM structure (normal phantom etc) and Full File path
my main aim is to automate the BOM export to Excel in a standardised format, not relying on the individual seat of inventor having the BOM View customised correctly.
Thanks in advance all help appreciated!
Steve Oliver