Skip to content

Using CSL logic in your mappings

The basic functionality of CAD property mapping allows you to map CAD properties to production inputs or UDAs. aPriori implements the mapping by setting each mapped production input or UDA to the value of the CAD property mapped to it. In the basic case, the value of the production input or UDA exactly matches the value of the CAD property. More advanced functoinality allows you to direct aPriori to set the production input or UDA to a specified transformation of the CAD property value. You define the transformation with CSL logic. For example, the CAD property COMMODITY with a value of “Casting” could be mapped to the value “Casting – Die” for the Process Group production input.

You can also use CSL expressions to base the value of a production input or UDA on multiple CAD properties, rather than on a single CAD property.  For example, the value of the production input Digital Factory can be chosen based on the values of both the PRODUCTION_REGION and TOOLING_REGION CAD properties.

For a brief introduction to CSL, see the CSL Overview section of the chapter "Working with Cost Model Logic" in the aP Pro Cost Model Workbench Guide. See also the chapter "Cost Scripting Language Reference" in the same Guide.

Basic examples of CSL logic

Following are some examples of using CSL logic into your mapping file. The first example shows a commented-out simple mapping between the Creo® COMMODITY property and the aPriori Process Group production input. It has been replaced by a CSL expression that checks whether COMMODITY is set to "Casting". If it is, the aPriori Process Group is set to Casting – Die. If not, the Process Group is set to Plastic Molding.

Image

A more complex CSL expression is used to determine the correct aPriori Digital Factory based on the value of the Creo PRODUCTION_LOCATION property:

Image

CSL cannot directly access the value of named properties, so the <source> tag also includes an id attribute that CSL uses. The PRODUCTION_LOCATION property may be one of several cities, so the CSL code evaluates whether the city is in the United States or China and picks the correct Digital Factory for that region. As a back-up, if neither region is recognized, the "aPriori Mexico" Digital Factory is chosen.

See also Advanced CSL Logic Examples.