Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I have a example:
I have excel file data with renumber and partnumber is correct. Now, I want change Renumber matching ItemNumber in Inventor correct with data excel file.
I use Structure - FirstLevelOnly = True.
Could you please help me write some code?
Thank you.
Sub RenumberExportBOMsample()
Dim oWkbk As Workbook
Set oWkbk = ThisWorkbook
Dim oSheet As Worksheet
Set oSheet = oWkbk.ActiveSheet
Dim oInv As Inventor.Application
Set oInv = GetObject(, "Inventor.Application")
Dim oDoc As Document
Set oDoc = oInv.ActiveDocument
' Set a reference to the assembly document.
' This assumes an assembly document is active.
Dim oAssy As AssemblyDocument
Set oAssy = oInv.ActiveDocument
Dim oCell As Range
Dim sParamRange As String
sParamRange = "A43:A120"
' Set a reference to the BOM
Dim oBOM As BOM
Set oBOM = oDoc.ComponentDefinition.BOM
oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = True ' Display First level
oBOM.StructuredViewMinimumDigits = 3
Dim oBOMView As BOMView
Set oBOMView = oBOM.BOMViews.Item("Structured")
Dim oRow As BOMRow
Dim sItemNum() As String
For Each oRow In oBOMView.BOMRows
If oRow.ComponentDefinitions.Item(1).Type = kComponentDefinitionObject Then
Next
End Sub
Solved! Go to Solution.