### Expressions Used in Standard Templates

In the various standard report and label templates, you will see several reporting expressions used to display different pieces of information or to format the display of information. For example, consider the code behind feature.lbl, a standard label template that ships with PC-DMIS.

To do this, open feature.lbl inside of the Label Template editor. The label displays showing some formatted sample data:

Next, select the GridControlObject, then double-click on it to activate it, displaying the code behind the displayed information:

Right-click on any cell to view the expression used.

In this template, you will see several reporting expressions (=LOADSTR, =DIM_MEASURED, =NOMINAL and so on) that determine what information PC-DMIS should display in the cells.

Common Expressions

The following list describes the most common expressions used in the various standard templates:

Some of these functions are also discussed in the "Functions and Operators" topic.

- =<Expression>:N - This allows you to display repeated information. See "Using a Type Index to Display Specific Data" and "Predefined Constants" for more information on repeating rows.

- =AXIS - This displays the current axis name (XAXIS, YAXIS, or ZAXIS).

- =DIM_MEASURED - This displays the measured value from a dimension.

- =DEVIATION_ANGLE - This displays a decimal value representing the deviation angle in degrees of a Position dimension. This is used to draw the radial graphic for the Position dimension templates.

- =DEVPERCENT_NOM - This displays a decimal value representing the percentage of the total tolerance range that marks the 0 deviation (nominal) position on the linear graphic. For a bilateral tolerance where the +/- values are equal this would be 50.0 (percent); the center of linear graphic represents 0 deviation. For a non-bilateral tolerance this would be 0.0; the leftmost side of linear graphic represents 0 deviation.

- =DEVPERCENT2 - When USETWODEVIATIONS is true (see USETWODEVIATIONS below), this displays a decimal value representing the percentage of the + tolerance used by the max deviation of a bilateral profile reported as form and location. The percentage of the – tolerance used by the min deviation is given by DIM_RPT_DEVPERCENT.

- =DIM_DEVIATION - This displays how much a dimension deviates from the nominal.

- =DIM_OUTTOL - This displays the out of tolerance value for a dimension.

- =DIM_MAX - This displays the maximum value for the given axis among all points related to the input feature.

- =DIM_MEASURED - This displays a dimension's measured value.

- =DIM_MIN - This displays the minimum value for the given axis among all points related to the input feature.

- =DIM_RPT_DEVPERCENT - This displays a decimal value representing the percentage of the total tolerance range that marks the deviation of this dimension.

- =DIM_RPT_GRAPHIC - This displays an integer value representing the type of graphic control PC-DMIS should display for the dimension.

0 report no graphic control

1 report the linear graphic control

2 report the radial graphic control

- =DIM_RPT_ISBILATERAL - This expression determines whether or not the linear graphic represents a bilateral tolerance (+/- tolerance value) such as the size of a hole or profile reported as form and location. Examples of tolerances that are not bilateral (single tolerance value) are form tolerances such as circularity, flatness and straightness and profile reported as form only. Values can be “0” (false) or “1” (true).

- =DIM_RPT_NUMZONES - This displays a decimal value indicating the number of tolerance zones (from 0 deviation to the maximum allowed deviation) to be drawn on the linear graphic. You can set this in the Edit Dimension Color dialog box (select Edit | Graphics Display Window | Dimension Color). You can assign each zone a unique color to show by the color of the linear graphic how much of the tolerance was used by the deviation of the dimension.

- =F_PLUS_TOL - This displays a feature's plus tolerance.

- =F_MINUS_TOL - This displays a feature's minus tolerance.

- =ID - This displays the feature or dimension ID.

- =LOADSTR - This loads a string from a table of stored strings within PC-DMIS. See "Loading Strings from PC-DMIS" for more information.

- =NOMINAL - This displays the nominal data for a feature.

- =Page() - This displays the current page number of the Report window.

- =Pages() - This displays the total number of pages of the Report window.

- =TOL - This function colors any text or expressions.

- =UNIT_TYPE - This displays the unit of measurement for the feature or dimension.

- =USETWODEVIATIONS - This expression determines whether or not the legacy dimension label template's linear graphic uses two deviation values. Bilateral profile reported as form and location displays how much of the + tolerance was used by the max deviation and how much of the – tolerance was used by the min deviation. Values can be either “0” (false) or “1” (true)

Combined Expressions

You may also find that expressions can be combined and used together with other expressions, as shown in this code string taken from the Legacy_Dimension_Cad.lbl label template:

=TOL(DIM_DEVIATION:N,DIM_OUTTOL:N,0.0,0.0)

This uses the =TOL function to display the dimension's deviation value and give it the Error color (usually red).

Another example is found in standard report templates in version 4.2 and higher. The Text object at the bottom of those templates uses this combined expression in the Text property to display the current page number along with the total number of pages:

=page() + " Of " + pages()

So page six of a ten page report would read as follows at the bottom of the page in the Report window:

6 Of 10