Inventor 2022 introduced the suppress component feature in the State Master.
How can I get the properties of the BOMRow if there is no component definition?
I mean, if I can't access the component definition, how do I get the Part Number, for example?
Solved! Go to Solution.
Inventor 2022 introduced the suppress component feature in the State Master.
How can I get the properties of the BOMRow if there is no component definition?
I mean, if I can't access the component definition, how do I get the Part Number, for example?
Solved! Go to Solution.
Solved by dalton98. Go to Solution.
Hello. You will have to open the document in the background in order to view that info. How I understand it: Every file that is referenced in your current assembly is technically open but you cant see it. You can check this with "ThisApplication.Documents.Count"
Use something like this to get the part number of suppressed parts from the bom
Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oBOM As BOM = oADoc.ComponentDefinition.BOM Dim oBOMView As BOMView = oBOM.BOMViews.Item(1) For Each oRow As BOMRow In oBOMView.BOMRows If oRow.ComponentOccurrences.Count = 0 filename = oRow.ReferencedFileDescriptor.FullFileName Dim oDoc As Document oDoc = ThisApplication.Documents.Open(filename, False) partnumber = oDoc.PropertySets.Item(3).Item("Part Number").Value MessageBox.Show(partnumber) oDoc.Close End If Next
Hello. You will have to open the document in the background in order to view that info. How I understand it: Every file that is referenced in your current assembly is technically open but you cant see it. You can check this with "ThisApplication.Documents.Count"
Use something like this to get the part number of suppressed parts from the bom
Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oBOM As BOM = oADoc.ComponentDefinition.BOM Dim oBOMView As BOMView = oBOM.BOMViews.Item(1) For Each oRow As BOMRow In oBOMView.BOMRows If oRow.ComponentOccurrences.Count = 0 filename = oRow.ReferencedFileDescriptor.FullFileName Dim oDoc As Document oDoc = ThisApplication.Documents.Open(filename, False) partnumber = oDoc.PropertySets.Item(3).Item("Part Number").Value MessageBox.Show(partnumber) oDoc.Close End If Next
Thank you very much, Dalton.
I was hoping there was an alternative that would not force me to open the file, but al least, there is a roundaraound!
Thank you very much, Dalton.
I was hoping there was an alternative that would not force me to open the file, but al least, there is a roundaraound!
Can't find what you're looking for? Ask the community or share your knowledge.