It is posible to import BOM from VB.NET ?

It is posible to import BOM from VB.NET ?

Anonymous
Not applicable
709 Views
5 Replies
Message 1 of 6

It is posible to import BOM from VB.NET ?

Anonymous
Not applicable

Hello,

 

I'm using Inventor 2015 and I need to customize the BOM so I have to import an .xml file from code but I don't know how to do it from VB.NET.

 

 

I have seen some responses but it's from VBA:

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

 

And this is what I would be doing from Inventor GUI that I want to do from VB.NET:

0 Likes
710 Views
5 Replies
Replies (5)
Message 2 of 6

EScales
Advocate
Advocate

I need to do this exact thing. Anybody have a solution for this yet?

0 Likes
Message 3 of 6

MechMachineMan
Advisor
Advisor
Sub Main()

Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument

Dim oAsmDef As AssemblyComponentDefinition
oAsmDef = oAsmDoc.ComponentDefinition

Dim oBOM As BOM
oBOM = oAsmDef.BOM

Dim filename As String 'assume the file exists
filename = "c:\temp\BOM_Columns.xml"

oBOM.ImportBOMCustomization(filename)

End Sub

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

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 4 of 6

EScales
Advocate
Advocate
I get the following error message: Public member 'ImportBOMCustomization' on type 'BOM' not found.
0 Likes
Message 5 of 6

MechMachineMan
Advisor
Advisor

BOM.ImportBOMCustomization Method
Parent Object: BOM
Description
Import BOM column customization as XML file.
Syntax
BOM.ImportBOMCustomization( FileName As String )

is what programming help says. Unless you are using an inventor version before 2015, I no longer have any clue.

 

 

EDIT:

 

I just tested it in Inventor 2016, in an assembly document and it works flawlessly when I changed the filename to my desired location.

 

Depending on wha tools you are using to make the program, some of that may be out-dated and causing you issues as they only added in the functionality for this in 2015 and up.


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

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 6 of 6

EScales
Advocate
Advocate
I'm using Inventor 2014 now, but should be upgrading to 2016 soon.
0 Likes