Export BOM with Occurence Name (from assembly)

Export BOM with Occurence Name (from assembly)

inventor4578
Advocate Advocate
170 Views
2 Replies
Message 1 of 3

Export BOM with Occurence Name (from assembly)

inventor4578
Advocate
Advocate

Hi,

I know we have a lot of iLogic to make BOM from assembly, but i found nothing to get the Occurence Name of each component ?

 

inventor4578_0-1695367622526.png

 

Thanks

 

0 Likes
171 Views
2 Replies
Replies (2)
Message 2 of 3

inventor4578
Advocate
Advocate

Any idea for this BOM ? Thank you very much

0 Likes
Message 3 of 3

A.Acheson
Mentor
Mentor

Hi @inventor4578 

You can pick this up from a loop of occurrences. See this article for the samples written in VBA

The name is displayed in the ilogic logger. 

Code below in VB.NET for ilogic environment.

' Get the active assembly.
    Dim oAsmDoc As AssemblyDocument
    oAsmDoc = ThisApplication.ActiveDocument

    ' Get the assembly component definition.
    Dim oAsmDef As AssemblyComponentDefinition
    oAsmDef = oAsmDoc.ComponentDefinition

    ' Get all of the leaf occurrences of the assembly.
    Dim oLeafOccs As ComponentOccurrencesEnumerator
    oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences

    ' Iterate through the occurrences and print the name.
    Dim oOcc As ComponentOccurrence
    For Each oOcc In oLeafOccs
        Logger.Info(oOcc.Name)
    Next

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes