Community
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 ?
Thanks
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
Can't find what you're looking for? Ask the community or share your knowledge.