@Remy-intl
I would like to update the code provided by @bradeneuropeArthur . See below, this will show you the assembly name and the corresponding BOM structure in the message box.
Public Sub Main
Dim a As Inventor.Application = ThisApplication
Dim b As Inventor.AssemblyDocument = a.ActiveDocument
Dim c As Inventor.AssemblyComponentDefinition
Call Loopi(b)
End Sub
Public Sub Loopi (a As Inventor.AssemblyDocument)
Dim b As Inventor.ComponentDefinition = a.ComponentDefinition
Dim occs As Inventor.ComponentOccurrences = b.Occurrences
Dim occ As Inventor.ComponentOccurrence
'.Document
For Each occ In occs
If occ.DefinitionDocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
Dim occdoc As Inventor.AssemblyDocument
occdoc = occ.Definition.Document
MsgBox(System.IO.Path.GetFileName(occdoc.FullFileName) & "----" & occ.BOMStructure.ToString)
Loopi(occdoc)
End If
Next
End Sub
Hope this will help.
If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!
Regards,
Dutt Thakar
LinkedIn