Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm on Inventor 2019.4.1 using ilogic trying to get the BOM quantity/length, I can get the length of the first item but after that any call to BOMQuantity.GetBaseQuantity() fails.
Is this a known bug?
Cut and paste code if you want to test
Dim doc As AssemblyDocument If ThisApplication.ActiveDocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then doc = ThisApplication.ActiveDocument Else MessageBox.Show("You've got to have an assembly as the active document to run the tool") Exit Sub End If Dim allParts As ComponentOccurrencesEnumerator allParts = doc.ComponentDefinition.Occurrences.AllLeafOccurrences For Each part As ComponentOccurrence In allParts If part.Definition.BOMQuantity.BaseUnits = "m" Or part.Definition.BOMQuantity.BaseUnits = "mm" Then MessageBox.Show(part.Name) MessageBox.Show(part.Definition.BOMQuantity.BaseUnits) Dim val As Inventor.Parameter Dim type As BOMQuantityTypeEnum part.Definition.BOMQuantity.GetBaseQuantity(type, val) MessageBox.Show(val.Value) End If Next
Solved! Go to Solution.