02-19-2018
02:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-19-2018
02:55 AM
Here is the exact code I used to test :
Sub test()
Set oAss = ThisApplication.ActiveDocument
Set oBOM = oAss.ComponentDefinition.BOM
'Define file name to export current BOM config
BOM_tempo = Environ("temp") & "\BOM_tempo.xml"
'if existing file, delete it
On Error Resume Next
Kill BOM_tempo
On Error GoTo 0
'1-Export active BOM config, in order to restore it
Call oBOM.ExportBOMCustomization(BOM_tempo)
'2-Load the custom BOM config file
oBOM.ImportBOMCustomization ("c:\temp\custom BOM.xml")
'3-Restore the original BOM config file
Call oBOM.ImportBOMCustomization(BOM_tempo)
End Sub
Test procedure :
- Open an iam
- From Inventor, edit BOM and modify columns
- Close BOM
- Launch the program in debug mode
- STOP at 1
- Check BOM_tempo value and check date of the file BOM_tempo.xml --> it's ok
- Run and STOP at 2
- EXIT the program, go back to Inventor
- Open the BOM
- Load manually the file BOM_tempo.xml --> NOT ok