Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export BOM with Occurence Name (from assembly)

2 REPLIES 2
Reply
Message 1 of 3
inventor4578
101 Views, 2 Replies

Export BOM with Occurence Name (from assembly)

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

 

2 REPLIES 2
Message 2 of 3
inventor4578
in reply to: inventor4578

Any idea for this BOM ? Thank you very much

Message 3 of 3
A.Acheson
in reply to: inventor4578

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report