Built-In Function $COUNT_PARTS 

Use

You use built-in function $COUNT_PARTS in a procedure, to produce a sum of the values of a characteristic and set this sum as a value for a characteristic.

The procedure can only be processed properly if all the relevant BOM components are known in the configuration. For this reason, only process the procedure at the end of the BOM explosion.

$SELF.<characteristic> = $COUNT_PARTS (<object variable>)

 

You can create a configurable dummy material to use as the last item in a BOM. Assign characteristic QUANTITY to the material. Allocate a procedure with the following source code to the BOM item:

$SELF. QUANTITY = $COUNT_PARTS ($PARENT)

$SELF is characteristic QUANTITY of the BOM item that has the procedure. $COUNT_PARTS adds together the quantities of all components of the BOM of superior material $PARENT, to infer a value for this characteristic.

You use a constraint to transfer this value to the superior characteristic.

Prerequisites

You can only use this function of a procedure for an object that can be configured interactively on multiple levels.

The summation assumes that all components are counted in the same unit of measure (for example, piece).

Features