Add Custom iproperty columns with ilogic ?

Add Custom iproperty columns with ilogic ?

Darkforce_the_ilogic_guy
Advisor Advisor
346 Views
4 Replies
Message 1 of 5

Add Custom iproperty columns with ilogic ?

Darkforce_the_ilogic_guy
Advisor
Advisor

is there a way to add  Custom iProperty columns  with Ilogic ? If not is that a good way to update all our old files to a news standard setup ?

 

 

Darkforce_the_ilogic_guy_0-1706089473503.png

 

 

sdf

0 Likes
347 Views
4 Replies
Replies (4)
Message 2 of 5

Andrii_Humeniuk
Advisor
Advisor

Hi @Darkforce_the_ilogic_guy .With the ExportBOMCustomization and ImportBOMCustomization methods, you can first save your BOM table settings to an XML file and then import those settings to all your assemblies.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 5

Darkforce_the_ilogic_guy
Advisor
Advisor

how would i do that with ilogic ?

0 Likes
Message 4 of 5

m_baczewski
Advocate
Advocate

Hello, 

 

At the beginning, it is necessary to remember to manually edit the table and then export it to a specific location. 

2024-01-24_12h34_51.png

Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument

Dim oBom As BOM
oBom = oDoc.ComponentDefinition.BOM

oBom.ImportBOMCustomization("Your .xml BOM customization path") ' C:\Users\YOU\Desktop\BOMcustomization.xml

InventorVb.DocumentUpdate()

 

 

0 Likes
Message 5 of 5

Andrii_Humeniuk
Advisor
Advisor

Example of exporting settings:

 

Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
Dim oADoc As AssemblyDocument = oDoc
Dim oBOM As BOM = oADoc.ComponentDefinition.BOM
Dim sPathFile As String = "D:\BOM.xml"
oBOM.ExportBOMCustomization(sPathFile)

 

Example of importing settings:

 

Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
Dim oADoc As AssemblyDocument = oDoc
Dim oBOM As BOM = oADoc.ComponentDefinition.BOM
Dim sPathFile As String = "D:\BOM.xml"
oBOM.ImportBOMCustomization(sPathFile)

 

Line 5 is the path to the .xml file.

If you need to update the BOM table in sub-assemblies, you can use the For each statement, here is an example:

Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
Dim oADoc As AssemblyDocument = oDoc
Dim sPathFile As String = "D:\BOM.xml"
For Each oRefDoc As Document In oADoc.AllReferencedDocuments
	If oRefDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Continue For
	If Not oRefDoc.IsModifiable Then Continue For
	Dim oBOM As BOM = oRefDoc.ComponentDefinition.BOM
	Try : oBOM.ImportBOMCustomization(sPathFile) : Catch : End Try
Next

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes