Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Get part number of a BOMRow with all instances supressed

jgaston
Participant

Get part number of a BOMRow with all instances supressed

jgaston
Participant
Participant

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?

0 Likes
Reply
Accepted solutions (1)
367 Views
2 Replies
Replies (2)

dalton98
Collaborator
Collaborator
Accepted 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

 

 

jgaston
Participant
Participant

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!

0 Likes