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: 

BOM XML Import Via VB or iLogic

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
6082 Views, 6 Replies

BOM XML Import Via VB or iLogic

Does anyone know if it is possible to run the 'import .xml structure' routine for an assembly BOM using either iLogic or VB?? I'm trying to replicate the Import button at the bottom of the BOM screen.....

 

I've been trawling for days with no success.

 

Any help would be much appreciated!

6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

I do not see any Import method for the BOM or BOMView objects in the API.  There is of course an Export method.

 

Help me out here. 

 

Why would one want to import BOM items into an Assembly? 

 

If we are talking components that are not modeled wouldn't you want to add them to the assembly as virtual components so that everything flows in the right direction?

Message 3 of 7
Anonymous
in reply to: Anonymous

Thanks for the reply!

 

I am trying to import the structure of the BOM, not the content. Capture.JPG

I can add custom iProperties through VB, but for these to appear in the BOM, i need to add the relevant columns to the BOM view. I can do this via an .xml file, using this import button. It is this function i need to automate. Otherwise, every time i want to add a new iProperty, i would have to open every assembly and run this import.........

 

Any ideas???

 

 

Message 4 of 7
Anonymous
in reply to: Anonymous

Not really.  As I said they do not support BOM Import in the Inventor programming API

 

Message 5 of 7
Anonymous
in reply to: Anonymous

Thanks for the input mate, it's just frustrating to see a button that I can't click in code when required......

 

Cheers anyway!

Message 6 of 7
CadUser46
in reply to: Anonymous

Has anyone found a way to do this yet that they would like to share?  It would be nice but i assuming since its still not in the object browser for the BOMView class in 2012 it still cant be done.

 

For reference here are other threads.

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Automate-Import-Bom-Customization/m-p/...

 

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/API-for-import-export-BOM-customizatio...

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
Message 7 of 7

This is now possible. Im not sure in which version it was added, but this method works in 2018.

 

Public Sub BOMCustomizationImport()
    ' Set a reference to the assembly document.
    ' This assumes an assembly document is active.
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument
 
    ' Set a reference to the BOM
    Dim oBOM As BOM
    Set oBOM = oDoc.ComponentDefinition.BOM
     
    Dim oPath As String
    oPath = "C:\import\Test.xml"
     
    oBOM.ImportBOMCustomization (oPath)

End Sub

Also this works great with the new trigger options they just recently added.

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

Post to forums  

Autodesk Design & Make Report