Get BOM for a derived assembly or part

Get BOM for a derived assembly or part

shastu
Advisor Advisor
1,164 Views
1 Reply
Message 1 of 2

Get BOM for a derived assembly or part

shastu
Advisor
Advisor

Is there really no way to accomplish this?  If a part is derived, I want to be able to extract the information of what it was made from.  If I have an assembly abc that is made from parts 1, 2, and 3.  I can extract the BOM from abc.iam to an excel spreadsheet.  If however that same assembly is derived to file xyz.ipt, then I cannot extract the BOM.  I need to be able to extract the information that xyz is made from abc consisting of parts 1,2, and 3.  Does anyone know of a way to do that in VBA?  Any help would be greatly appreciated!!!

0 Likes
1,165 Views
1 Reply
Reply (1)
Message 2 of 2

bshbsh
Collaborator
Collaborator

there are ways to do this.

if your part is a component is a derived from another part, then it will have a reference to that part in

.ComponentDefinition.ReferenceComponents.DerivedPartComponents

if your part is a component is a derived from an assembly, then it will have a reference to that assembly in

.ComponentDefinition.ReferenceComponents.DerivedAssemblyComponents

you have to check the .Count property on these and branch your code if any of that is non zero.

let's say, you have a DerivedAssemblyComponents.Count = 1, then you can access the ComponentDefinition of that original Assembly through:

DerivedAssemblyComponents.Item(1).ReferencedDocumentDescriptor.ReferencedDocument.ComponentDefinition

 

this will not work if the link to the referenced assembly (or part) is suppressed or entirely unlinked. make sure to check this too:

DerivedAssemblyComponents.Item(1).LinkedToFile

and

DerivedAssemblyComponents.Item(1).SuppressLinkToFile

0 Likes