Add Ons P3L Cheat Sheet
Add ons are operation-like items that you can add to quote items that can influence total line item cost without influencing the unit price of a component. Things like non-recurring engineering work or tooling fees can be encapsulated by required add ons, where the buyer must purchase these alongside any quantity of a line item. Things like additional value added services or certifications can be encapsulated using non-required add ons that the user can optionally select at checkout if he or she finds it valuable. You can also use add ons to enforce things like minimum order item prices. Add ons can be templatized in a very similar way to operations. Just like with operations, add ons can be added to process templates, so that when a process is applied to a part, it will automatically generate the add ons specified in the template. Add on level P3L is very similar to operation level P3L, except it has access to a slightly different list of functions. You should read through the Operation P3L Cheat Sheet before going through this article.
Similar to operations, the purpose of add on P3L is to generate a price for a given add on for each quantity break. Additionally, add on P3L can also dynamically specify if an add on is required or not.
In add on P3L, you have access to all attributes of the `part` object as well as all of the built in python function and operators. You additionally have access to all functions specified in the Operation P3L Cheat Sheet EXCEPT for the following functions:
If you want to interface with certain aspects of interrogation information we can provide through our analysis request functions, we suggest you store that value in the workpiece from within one of your operations, and then access that value from the workpiece from within the add on.
NOTE: All workpiece and price dictionary logic works exactly as it does with operations. Add ons are always executed AFTER all operations. This means you will be able to access any and all information from the workpiece and price dictionary the operations have created.
There are only two additional functions that add ons P3L provides outside of operation P3L:
Set the name of the add on as it would appear in the user interface. If this function is not called, the name will default to the name of the add on definition in your processes page. This function is particularly useful if your add on naming convention depends on part attributes.
name is the string you would wish to rename the add on.
Sets the add on to be required or not based on the value. If you do not use this function, the is_required value will default to the value specified on the add on definition in your processes page.
key is a Boolean.
Accessing Surrounding Prices
As we saw with operation P3L, to access the price of surrounding add ons, you can use the
get_price_value(key) function. You can pass it an add on name or add on definition name and it will return the price of all cells that match that name string for the active quantity. Additionally, there are two special keys to collect accumulated values. Using
get_price_value('--required_add_on--') will return prices of all cells above the active add on for required add ons. Using
get_price_value('--non_required_add_on--') will similarly return the price of all cells of above the active add on for non required add ons.