Set Blocks
Each set block has the following form:
set {
<formula> [
<formula>]*
}
A set block consists of the keyword “set” followed by a sequence of formulas enclosed in braces.
A formula that is not within a set block is evaluated only if either it is an output formula or its evaluation is required (directly or indirectly) for the evaluation of an output formula (see Formulas and Outputs). A formula that is within a set block is always evaluated as part of the evaluation of the module that contains it. The formulas in a set block are evaluated only after evaluation of all output formulas that are not contained in a set block.
Set blocks are typically used to pass information to other modules by setting fields of input objects. The following input objects are particularly useful for this purpose:
global: use this identifier to pass information from one process or operation to a sibling process or operation in the current routing or operation sequence, during process or operation taxonomy evaluation. It is set to null after each taxonomy evaluation pass (including after the yield pass).
perCosting: this identifier is set to null after every complete costing. Use this object for expensive computations that won't vary by routing. Caution: in some cases, the GCD hierarchy itself can vary by routing (for example, when aPriori creates RingedHoles for turning routings).
perRouting: This identifier is set to null after each routing evaluation. Note that there are potentially multiple evaluations of each routing—one for each stock.
Each of these inputs allows you to introduce new fields. For example, you can introduce new fields of global by using a formula whose left hand side is a complex identifier consisting of “global” followed by dot followed a new field name. See Inputs for information on input objects.
Example
 
set {
global.numScrapPartsDownStream = {
numScrapParts if safeEval(global.numScrapPartsDownStream, null) == null
numScrapParts + global.numScrapPartsDownStream otherwise
}
}
Example
 
set {
global.foo = 5
part.bar = ‘baz’
}