Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I am looking to get the Qty from the bom for a component or a virtual component.
Just about all posts I have read on this loop through all bom rows to get the quantity, but I only want to get the qty for a specific part.
The API diagram shows BOMQuantity as accessible from the VirtualComponentDefinition without having to go through the BOM object.
Is there a simple oneline I can use for this?
Starting code,
Dim oAsmCompDef As AssemblyComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition Dim oOcc As ComponentOccurrence Dim oOccs = oAsmCompDef.Occurrences For Each oOcc In oAsmCompDef.Occurrences If TypeOf oOcc.Definition Is VirtualComponentDefinition Then If oOcc.Name.Contains("REF_RAIL") Then strQTY = oOcc.BOMQuantity() MessageBox.Show("QTY = " & strQTY, "Title") End If End If Next
Solved! Go to Solution.