Custom iProperty and BOM Export

Custom iProperty and BOM Export

Jason.Rugg
Collaborator Collaborator
307 Views
3 Replies
Message 1 of 4

Custom iProperty and BOM Export

Jason.Rugg
Collaborator
Collaborator

For estimating purposes we need to be able to export a BOM to excel spreadsheet that includes a column that has lengths. We can currently do this but would like to automate it. Currently all parts have a G_L custom iproperty for lengths, to get this into the BOM we have to manually add the G_L property to the assembly level and then we are able to add the G_L column in the BOM to be able to export our lengths to a spreadsheet. 

 

I would like a single rule that would automatically add the G_L custom iproperty to an assembly model if it doesn't exist and then add that column to the BOM and then export/save the BOM (structured/all levels) to a spreadsheet in a desired location.

0 Likes
308 Views
3 Replies
Replies (3)
Message 2 of 4

JelteDeJong
Mentor
Mentor

the easiest way I can think of is to create a "Bom customization file" after you have done all your settings manualy

JelteDeJong_0-1637611260251.png

and then import that file and export like this

 

Dim BomSettingsFile As String = "C:\temp\BomSettings.xml"
Dim BomFile As String = "C:\temp\bom.xlsx"
Dim doc As AssemblyDocument = ThisApplication.ActiveDocument
Dim bom As BOM = doc.ComponentDefinition.BOM
bom.ImportBOMCustomization(BomSettingsFile)
bom.BOMViews.Item("Structured").Export(BomFile, FileFormatEnum.kMicrosoftExcelFormat)

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 4

Jason.Rugg
Collaborator
Collaborator

@JelteDeJong Looks like that will get the export done for the spreadsheet but is there a way to get the rule to add the G_L custom iproperty to the assembly file if it doesn't exist?

0 Likes
Message 4 of 4

JelteDeJong
Mentor
Mentor

if you export the settings file after you added the G_L custom property column it will be in the settings file. Then when the rule imports the settings also the property will automatically be added.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes