VBA or iLogic to isolate parts/subassemblies set as 'Reference' in BOM structure

VBA or iLogic to isolate parts/subassemblies set as 'Reference' in BOM structure

TYoung_Combi
Advocate Advocate
582 Views
2 Replies
Message 1 of 3

VBA or iLogic to isolate parts/subassemblies set as 'Reference' in BOM structure

TYoung_Combi
Advocate
Advocate

Inventor Professional 2017

 

As the title suggests, I would like either a VBA or iLogic routine that will identify and isolate all parts/subassemblies in the upper level assembly which have had their BOM structure set to 'Reference'.

 

Any help would be greatly appreciated; thank you in advance.

0 Likes
Accepted solutions (1)
583 Views
2 Replies
Replies (2)
Message 2 of 3

mcgyvr
Consultant
Consultant
Accepted solution
oCompDef = ThisDoc.Document.ComponentDefinition
oAssemblyComponents = oCompDef.Occurrences

Dim oOccurrence As ComponentOccurrence

    For Each oOccurrence In oAssemblyComponents
        If (oOccurrence.BOMStructure = BOMStructureEnum.kReferenceBOMStructure) Then
            oOccurrence.Visible = True
        Else
            oOccurrence.Visible = False
        End If
    Next


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 3

TYoung_Combi
Advocate
Advocate

Greatly appreciated, @mcgyvr . Thank you very much!

0 Likes