Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
1372 Views, 9 Replies

BOM configurations using iLogic

I thought this one would be easy but is causing me some trouble. I have several BOM configurations that I need to export out of inventor. Right now I import the xml. file to get the configuration I want then check it before exporting the file. Is there a way to import the xml. file using iLogic?

 

My plan is to have the different BOM configurations set up as external rules and using a global form I can click on whatever BOM configurations I need to use. This way I just open the BOM and it’s ready to view or export.

 

 new picure.JPG

 

I tried to change some code I found on here but just not getting me anywhere (code below). I would appreciate any help you might be able to give.

 

Sub BOM_ColumnCustomizasion_Export ()
    Dim oAsmDoc As AssemblyDocument
    Set oAsmDoc = ThisApplication.ActiveDocument
    Dim oAsmDef As AssemblyComponentDefinition
    Set oAsmDef = oAsmDoc.ComponentDefinition
    
    Dim oBOM As BOM
    Set oBOM = oAsmDef.BOM
    
    Dim filename As String
    filename = "c:\temp\BOM_Columns.xml"
    Call oBOM.ExportBOMCustomization(filename)

    Beep
End Sub

Sub BOM_ColumnCustomizasion_Import ()
    Dim oAsmDoc As AssemblyDocument
    Set oAsmDoc = ThisApplication.ActiveDocument
    Dim oAsmDef As AssemblyComponentDefinition
    Set oAsmDef = oAsmDoc.ComponentDefinition
    
    Dim oBOM As BOM
    Set oBOM = oAsmDef.BOM
    
    Dim filename As String    'assume the file exists
    filename = "c:\temp\BOM_Columns.xml"  
    Call oBOM.ImportBOMCustomization(filename)

    Beep
End Sub

 

thanks

JD