Message 1 of 15
Calculate total assembly cost

Not applicable
06-30-2016
03:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've written a piece of iLogic code which calculates the material and labour costs of all my manufactured parts and writes the value to the 'Estimated Cost' iproperty. My code reads from an excel pricing sheet so that all the costs are kept up to date, I've even got it to calculate the labour costs of any assembly files ...so far so good
However at the final hurdle, I've ran into some difficulty when trying to generate a total cost of all parts and assemblies through exporting my top level BOM to an XLS document.
I think I'd like to export a first-level only BOM, but for this to work I need each assembly to total up the costs of each of its sub-parts.
Can anyone suggest a piece of code I could use to do this calculation?
Something like:
If openDoc.DocumentType = 12291 Then
iProperties.Value("Project", "Estimated Cost") = Total cost of assembly sub-parts + assembly labour
End If