Question:
Is there any way to get an area for the entire assembly on the BOM? If you go to iProperties --> Physical it is shown there. But how to pull it from there and have it as Column in BOM? Can it be done using API ?
Solution:
Firstly, currently, no API to add/remove column of BOM. You have to add it manually in advance. The following is the steps to achieve your requirement. This also applies to Mass/Volume or other iProperties.
1. In the component file (such as a part), add one custom iProperty manually e.g. named “Area”. The type is Text.
2. add a iLogic rule with the component file. It will get the Area value from iProperty, and update the custom iProperty.
'current document doc = ThisDoc.Document 'unit manager of the document oUOM = doc.UnitsOfMeasure 'get the value of Area surfaceArea = iProperties.Area 'round the value with 4 valid numbers (optional) surfaceArea = Round(surfaceArea, 4) 'convert the value to a string with the unit of the document surfaceArea = surfaceArea.ToString() + " " + oUOM.GetStringFromType(oUOM.LengthUnits) + "^2" 'update the custom property "Area" we created iProperties.Value("Custom", "Area") = surfaceArea
3. add this rule with the iLogic trigger “Part Geometry Change”thus when the model changes, the rule will be executed automatically and update the custom property.
4. In the assembly >> BOM, add one custom column named “Area”.This column will read the custom property from the component.