Hi @buitrongcuongypbn2000. We do not have control of the columns included in the assembly's BOM from Inventor's API/iLogic/VBA. Another way to achieve what you seem to want would be to prepare the BOM the way you want it first, then export that customization out to an XML file. Then when you want to use that customization again, import that exported XML file again. Here is a very simple iLogic rule for either exporting or importing the BOM customization. But you would have to change the specified file path & name to suit your specific needs.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oBOM As BOM = oADoc.ComponentDefinition.BOM
Dim sBOMTemplate As String = "C:\Temp\MyBOMTemplate.xml"
'oBOM.ExportBOMCustomization(sBOMTemplate)
oBOM.ImportBOMCustomization(sBOMTemplate)
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)