Hello
There's AFAIK no way to move the BOM rows.
You can try to copy the item numbers from subassembly BOM to main assembly BOM and order by item number. This should "reorder" the BOM rows in main assembly BOM. After this you should renumber the main assembly.
Below is a VBA example. Don't know if it works 100%.
Option Explicit
Private Sub BOMReorder()
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oAssDoc As AssemblyDocument
Set oAssDoc = oApp.ActiveDocument
Dim oBOM As BOM
Set oBOM = oAssDoc.ComponentDefinition.BOM
If oBOM.StructuredViewEnabled = False Then Exit Sub
If oBOM.StructuredViewFirstLevelOnly = True Then Exit Sub
Dim oBOMView As BOMView
Set oBOMView = oBOM.BOMViews(2)
Dim oBOMRows As BOMRowsEnumerator
Set oBOMRows = oBOMView.BOMRows
Dim oBOMRow As BOMRow
For Each oBOMRow In oBOMRows
If Not oBOMRow.ChildRows Is Nothing Then
Call TraverseBOM(oBOM, oBOMRow)
End If
Next
Call oBOMView.Sort("Item")
Call oBOMView.Renumber
End Sub
Private Sub TraverseBOM(ByRef oBOM As BOM, ByRef oBOMRow As BOMRow)
Dim oRefedDoc As AssemblyDocument
Set oRefedDoc = oBOMRow.ComponentDefinitions(1).Document
Dim oSubBOM As BOM
Set oSubBOM = oRefedDoc.ComponentDefinition.BOM
oSubBOM.StructuredViewEnabled = True
oSubBOM.StructuredViewFirstLevelOnly = False
Dim oSubBOMView As BOMView
Set oSubBOMView = oSubBOM.BOMViews(2)
Dim oBOMRows As BOMRowsEnumerator
Set oBOMRows = oBOMRow.ChildRows
Dim oChildRow As BOMRow
Dim oSubChildRow As BOMRow
Dim i As Integer
For Each oChildRow In oBOMRows
For i = 1 To oSubBOMView.BOMRows.Count
If oSubBOMView.BOMRows(i).ReferencedFileDescriptor.FullFileName = oChildRow.ReferencedFileDescriptor.FullFileName Then
oChildRow.ItemNumber = oSubBOMView.BOMRows(i).ItemNumber
End If
Next
If Not oChildRow.ChildRows Is Nothing Then
Call TraverseBOM(oBOM, oChildRow)
End If
Next
End Sub
R. Krieg
RKW Solutions
www.rkw-solutions.com