Export BOM using VB.net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I created a program to export the Assembly BOM to Excel. I am running into a some strange behaviour regarding Weldments and Inseparable assemblies. Here is a snippet of my code:
'Create BOM Object
Dim oBom As Inventor.BOM
oBom = oAssyDoc.ComponentDefinition.BOM
oBom.StructuredViewEnabled = True
oBom.StructuredViewDelimiter = "."
oBom.StructuredViewFirstLevelOnly = False
'Create BOMView Object
Dim oBomView As Inventor.BOMView
oBomView = oBom.BOMViews.Item(2)
'Create Row Object and run For loop to export
Dim oRow As Inventor.BOMRow
For Each oRow In oBomView.BOMRows
'This is where I put my code to export and write the file.
Next
I run into the issue of the items inside a Weldmant assembly is not being exported. Yet I am able to create a structured multilevel partslist on my drawing showing all the items inside the Weldment.
Whats strange is that even if I change the Weldment assy’s BOM structure to Normal, it still does not make a difference.
Is there a way to get the items of a Weldment into my BOMRows object so that it will export?
Whats starnge is that if an assembly is set to “Inseparable” but is not a weldment then it exports the contents.
Any light on the subject would be appreciated!