What's new

Script Release: Total Cost Center V3

NateLiquidGravity

Alibre Super User
upload_2020-7-15_21-37-42.png

This script lists and totals the Cost for each part in an assembly based on the value found in File Properties > Part Data > Cost Center. It currently includes hidden or suppressed items (if enabled) but it ignores values in the assembly and sub-assemblies file properties to eliminate duplication.

Note:
Use at your own risk. This script uses undocumented and unsupported features of AlibreScript. Be extremely careful with modifications.

V2 released 11/18/2019 fixes incorrectly adding subtotals and makes printing for large assemblies nearly instant.
Total_Cost_Center_V2.py had 20 downloads when it was replaced.

V3 released 7/15/2020 adds a UtilityDialog to make including suppressed items optional. Changed print formatting.
 

Attachments

  • Total_Cost_Center_V3.py
    3.5 KB · Views: 15
Last edited:

NateLiquidGravity

Alibre Super User
V2 released 11/18/2019 fixes incorrectly adding subtotals and makes printing for large assemblies nearly instant.
Thanks @idslk for catching that.
My apologies to anyone who used it. Please download the new version.
 

handily1

New Member
This script lists and totals the Cost for each part in an assembly based on the value found in File Properties > Part Data > Cost Center. It currently includes hidden or suppressed items but it ignores values in the assembly and sub-assemblies file properties to eliminate duplication.

Note:
Use at your own risk. This script uses undocumented and unsupported features of AlibreScript. Be extremely careful with modifications.

V2 released 11/18/2019 fixes incorrectly adding subtotals and makes printing for large assemblies nearly instant.
Nate, How does your script get incorporated into the BOM in Alibre?
 

NateLiquidGravity

Alibre Super User
Unfortunately it is not yet. I've yet to see if such a thing is possible. However I'm working on a Assembly Matrix with guidance from Lew and that will create it's own separate spreadsheet BOM.
 

cncgear

Member
Hi,

Great script and I will use this extensively, but... what can be added to the script to process non-suppressed parts / assemblies only so the total cost represents what is active in the current window and ignores suppressed items?

Also, and this is a 'nice to have' can the total cost be displayed in a pop up window?


Many, many thanks
 

idslk

Alibre Super User
Hello Nate,

have you thought about using a own Custom Property for the cost instead of using the StandardProperty "Cost Center"?

Regards
Stefan
 

cncgear

Member
Nate,

Thanks, this script runs very, very well and has eased my cost analysis somewhat. I do have one issue though, sorry to be a pain. I have attached a part for you to look at, this is an assembly, but, the cost should look at the assembly cost, not the part cost in this instance, because obviously bearings are sold as complete units, not parts thereof.

Simply put, if an assembly has the 'Treat as BOM when used in sub assembly..." set to on, the parts should be ignored and the assembly 'cost center' data used to add the cost to the total.

I hope that makes sense?
 

Attachments

  • 8mm Flanged Bearing.AD_ASM
    223 KB · Views: 3
Last edited:

DavidJ

Administrator
Staff member
The assembly file alone will be of no use to Nate - he'll need a package file created from the assembly. Assembly files only hold the 'rules of assembly' , not the actual constituent parts.
 
Hi Nate -- One of the things I have long been arguing for within File Properties->General->Part Data is a Make/Buy designation. We can (and ought to) add such a definition to the Custom Properties assignment (the first thing I did after recognizing them). Just and idea... -- Lew
 

NateLiquidGravity

Alibre Super User
Unfortunately the "treat as part when used on BOM" is not accessible from the Alibre API. I have asked for it to be added but it hasn't happened yet. Please ask support for it to be added to the API.
 

NateLiquidGravity

Alibre Super User
+100 -- Lew
Yes this is something holding up the Project Matrix I was doing for you. The other thing is that AlibreScript (and maybe the API - I haven't dug that deep) ignore the configurations set at the assembly level.

Say you have configurations (Small, Medium, and Large) for a part Soda_Cups and your assembly has 3 each Small, 2 each Medium, and 6 each Large. In AlibreScript I can only see that there are 11 Soda_Cups that all report their active configuration as Small (because Small was active last when the Soda_Cups part was last edited). I won't release the Project Matrix until those things are fixed.
 

DavidJ

Administrator
Staff member
Unfortunately the "treat as part when used on BOM" is not accessible from the Alibre API. I have asked for it to be added but it hasn't happened yet. Please ask support for it to be added to the API.

This is already with Development to add it to API.
 
Top