Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I get the Parent P/N from a BOM row in a BOM?

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
286 Views, 0 Replies

Can I get the Parent P/N from a BOM row in a BOM?

I noticed there is a "Parent" Property under the BOM Row Members. I am not sure how to use it (format it) to get the Parent Part Number from a structured BOM.

To get the other BOM properties, I cam using the following code. I would like to also write the parent part number to the file.


{code}

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 oDescProperty As Property


'Get the file property that contains the "Part Number"
Set oPartNumProperty = oCompDef.Document.PropertySets _
.Item("Design Tracking Properties").Item("Part Number")

'Get the file property that contains the "Description"
Set oDescProperty = oCompDef.Document.PropertySets _
.Item("Design Tracking Properties").Item("Description")

Write #1, oRow.ItemNumber; oPartNumProperty.Value; oRow.ItemQuantity; _
oDescProperty.Value

If Not oRow.ChildRows Is Nothing Then
Call QueryBOMRowProperties(oRow.ChildRows, ItemTab)
End If
Next

{code}
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report