For example, suppose you have the following Location dimension that references a circle named CIR1:

DIM LOC1= LOCATION OF CIRCLE CIR1 UNITS=IN ,$

GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH

...

END OF DIMENSION LOC1

You can use the GetFeatureSetID function inside a rule to automatically determine the label that gets displayed for this dimension depending on whether or not CIR1 exists inside of a feature set.

For example, this rule will automatically use the LEGACY_DIMENSION.LBL label if it cannot find a FEAT/SET command that contains CIR1:

USE TEMPLATE "=GetFeatureSetID("LEGACY_DIMENSION.LBL")"

If there is a FEAT/SET command, you can then change the ID for that command to match the desired label name you want to use (or change a label file name to match the ID) and PC-DMIS will use that label instead.

In this code here, notice that the FEAT/SET references CIR1. It also has its usual label identification changed to "REFERENCE_ID". So that the GetFeatureSetID function will return "REFERENCE_ID.LBL":

REFERENCE_ID=FEAT/SET,CARTESIAN

THEO/<0,0,0>,<0,0,1>

ACTL/<0,0,0>,<0,0,1>

CONSTR/SET,BASIC,CIR1,,

=IsMarkedForArm(1)

would return 1 if the current command is marked for arm 1, otherwise it returns 0.

=IsMarkedForArm(2)

would return 1 if the current command is marked for arm 2, otherwise it returns 0.

=IsMarkedForArm(1) AND IsMarkedForArm(2)

would return 1 if the current command is marked for both arms, otherwise it returns 0.

#### Functions for Report Expressions

Items preceded with an asterisk symbol (*) are unique to the reporting expression language.

Function | Description
ABS(<expression>) | Returns the absolute value of the input value.
ACOS(<expression>) | Returns the arc-cosine for the input value. Input and result are in radians.
ANGLEBETWEEN(<expression1>, <expression2>) | Returns the angle between the two inputs expression1 and expression2, which should be of type vector. Result is in degrees.
ARRAY(<expression1>,<expression2>, & <expressionN>) | Creates an array out of the input values.
ASIN(<expression>) | Returns the arc-sine for the input value. Input and result are in radians.
ATAN(<expression>) | Returns the arc-tangent for the input value. Input and result are in radians.
CHR(<expression>) | Returns the ASCII character value for the corresponding input value which should be of type integer.
*COLOR(<expression1>, <expression2>) | Makes the text value of expression1 use one of the 4 colors as currently defined in the color tree. 1 = Marked Color 2 = Unmarked Color 3 = Step Mode Color 4 = Error Color. See "Changing a String's Text Color".
*GetTolColor(expression1, expression2, expression3) | This takes three expressions, the deviation, plus tolerance, and the minus tolerance and returns the current tolerance color as type COLORREF based on the deviation. expression1 is the deviation as a double value, expression2 is the plus tolerance as a double value, and expression3 is the minus deviation as a double value.

You can use this returned color with color properties of objects in reporting such as ForeColor and BackColor to dynamically change the color of the object to reflect the current tolerance value.

These colors are specified in the Edit Dimension Color dialog box. See "Editing Dimension Colors" in the "Editing the CAD Display" section

CONCAT(<expression1>, <expression2>, & <expressionN>) | Concatenates all of the strings specified in expressions 1 through N together into 1 string.
COS(<expression>) | Returns the cosine for the input value. Input and result are in radians.
*COUNT(expression1) | Returns the number of instances of the data type specified in expression1 for the current command.
CROSS(<expression1>, <expression2>) | Returns the cross product of expession1 and expression2 both of which should be of type vector.
*DATAFIELD(<expression1>, <expression2>, <expression3>) | Used only within the Custom Report Editor, this returns information from a specific data field within a feature, dimension, or command. This takes three parameters: expression1 is a string representing the unique id or id of the command, expression2 is a string representing the data type, and expression3 is the typeindex. Normally the typeindex is 0, but in cases where a dtype occurs more than once, it will be 1 or greater.

This expression is automatically created and used when you drag and drop items from the Edit window into your custom report.

DATEVALUE() | Same as in PC-DMIS expression language.
DEG2RAD(<expression>) | Converts the input from degrees to radians.
DELTA(<expression1>, <expression2>, <expression3>) | Output is new point moved along the vector specified in expression2 by the distance specified in expession3 from the point specified in expression1.
DISTANCEFROMEDGE() | Retrieves the distance of the measured centroid of the command's underlying feature from the closest edge on the CAD.

- If the underlying command is a feature, this uses the measured feature to return the distance.

- If the underlying command is a dimension, this uses the first feature in the dimension to return the distance.

You can use this function in the Rule Tree Editor to specify different label templates based on distances returned.

DOT(<expression1>, <expression2>) | Returns the dot product of expression1 and expression2. Input values should be of type point.
DOUBLE(<expression>) | Converts the input value from its current type to a double. In the case of a point, the distance of the point from the origin is returned.
*ELAPSEDTIME() | Returns the amount of time taken for execution.
ELEMENT(<expression1>, <expression2>, <expression3>) | Same as in PC-DMIS expression language.
EQUAL(<expression1>, <expression2>) | Tests whether two arrays are identical and returns 1 if they are, otherwise 0.
<expression1> ^ <expression2> | Same as in PC-DMIS expression language.
EXPON(<expression>)
*FILENAME() | Returns the full path and filename of the part program.
FORMAT(<expression1>, <expression2>) | Same as in PC-DMIS expression language.
*GETCOUNT(expression1) | Returns a long value of the number of instances that exist for the ENUM_FIELD_TYPES data type, specified in expression1. For example, a location dimension that reports in X,Y,Z, and D would return 4 for the Axis data type.
GETFEATURESSETID(<expression1>) | During execution, if the current command is a dimension, the function checks to see if the reference feature for this dimension is in a feature set. If it finds the reference feature in a set, it returns that set's ID as a string value with a ".lbl" extension appended to the end of the string. If it does not find a feature set command with the reference feature it returns the default string value supplied in <expression1>. This default value should be a label file name that includes the .lbl extension.

GETTEMP(<expression1>) | Returns the specified temperature or threshold value. One of these string values used for expression1 determines what gets returned:

- "TEMPP" - Returns the part temperature

- "TEMPX" - Returns the X axis temperature

- "TEMPY" - Returns the Y axis temperature

- "TEMPZ" - Returns the Z axis temperature

- "REF_TEMP" - Returns the temperature compensation reference temperature

- "HIGH_THRESHOLD" - Returns the temperature compensation high threshold

- "LOW_THRESHOLD" - Returns the temperature compensation low threshold

IF(<expression1>, <expression2>, <expression3>) | If expression 1 evaluates to a non-zero value, the value of expression 2 is returned, otherwise, the value of expression 3 is returned.
INDEX(<expression1>, <expression2>) | Same as in PC-DMIS expression language.
INTEGER(<expression>)
ISMARKEDFORARM(<expression>) | Used in multiple arm mode contexts, this function returns 1 if the command is marked for the arm specified in <expression>, otherwise it returns 0. This lets you control what is displayed in the report based on the command's executing arm.
LEFT(<expression1>, <expression2>) | Same as in PC-DMIS expression language.
LEN(<expression>) | For a string, returns the number of characters in the string. For an array, returns the number of elements in the array.
LN(<expression>) | Same as in PC-DMIS expression language.
*LOADSTR(<expression>) | Loads the string using the numerical value from the resource files. A negative numerical value causes the string to be loaded from the strings resources. See "Loading Strings from PC-DMIS" for more information.
LOG(<expression>) | Same as in PC-DMIS expression language.
LOWERCASE(<expression>)
<expression1> < <expression2>
MAX(<expression>)
MAXINDEX( <expression>)
MAXINDICES( <expression>)
*MEASSCALE() | Returns the re-scale factor used when measuring.
MIN(<expression>) | Same as in PC-DMIS expression language.
MININDEX(<expression>)
MININDICES(<expression>)
MID(<expression1>, <expression2>, <expression3>)
MPOINT(<expression1>, <expression2>, <expression3>)
*NUMMEAS() | Displays a number value representing the number of dimensions reported.
*NUMOUTTOL() | Displays the number of reported dimension that were out of tolerance.
ORD(<expression>) | Same as in PC-DMIS expression language.
*PARTNAME() | Displays the part name (the same as what is shown in the file header).
*PAGE() | Displays the current page number.
*PAGES() | Displays the total number of pages.
PAGEDIMCOUNT("CadReportObjectId",Range) | This function takes two parameters. If the first parameter is empty (nothing inside the quote marks), then this returns the number of dimensions in the current page with a max deviation less than Range*Tol. The second parameter, Range, is a floating number. If you include the CadReportObject ID in the first parameter, then this returns the number of dimensions in tolerance associated with the specified CADReportObject. Suppose you want to return the number of out of tolerance dimensions with CADReportObject1. You could use the following code to do this:
=TotalPageDimCount("CadReportObject1") - PageDimCount("CadReportObject1",1.0)
You can also calculate the number of dimensions that contain a specific number of axes by appending ":N" to the ID, where N is a number representing the number of axes. For example, typing =PageDimCount("CadReportObject1:4",1.0) would return the number of dimensions associated with CadReportObject1 that contained at least four axes and that had the fourth axis within the specified tolerance of 1.0. If you do not specify the number of axes, it would return the number of dimensions associated with CadReportObject1 if all of its axes were within the specified tolerance of 1.0.

RAD2DEG(<expression>) | Same as in PC-DMIS expression language.
REAL(<expression>) | Same as in PC-DMIS expression language.
*REGSETTING(<expression1>, <expression2>) | Displays a value of a specific registry setting. This takes these two parameters: expression1 determines the section, and expression2 determines the entry.
REPORTDIMCOUNT("<expression1">, <expression2>) | This function acts like the PageDimCount() function except that instead of displaying the number of out of tolerance dimensions for the current page, it displays the total number of out of tolerance dimensions for the entire report. In addition, for <expression1> you need to use CADReportObject1 as the ID, or leave it empty (with just the quotes).
*REPORTVALUE(<expression1>) | Displays the value of another object's property. It takes one parameter, shown as expression1. This should be a string value of the object's unique ID followed by a period and then the property's name, for example, =REPORTVALUE("text1.text")
*REVNUM() | Displays the revision number (the same as what is shown in the file header).
*RGB(<expression1>, <expression2>, <expression3>, <expression4>) | Colors the string specified in expression 1 to the color specified via the RGB values of expressions 2, 3, and 4. See "Changing a String's Text Color".
RIGHT(<expression1>, <expression2>) | Same as in PC-DMIS expression language.
ROUND(<expression1>, <expression2>)
*SECTION() | Displays the current section number.
*SERNUM() | Displays the serial number (the same as what is shown in the file header).
SIN(<expression>) | Same as in PC-DMIS expression language.
SORTUP(<expression>)
SORTDOWN(<expression>)
SQRT(<expression>)
*STATCOUNT() | Returns the statistics count (same as in the file header).
STR(<expression>) | Same as in PC-DMIS expression language.
STRING(<expression>)
SUM(<expression>)
SYSTIME()
SYSTEMDATE(<expression>)
SYSTEMTIME(<expression>)
*TOGGLESTR(<expression1>, <expression2>) | Pulls the toggle string from the resources base on the resource id value in expression1. Again, a negative number is used for cases where the string should come from the strings resources. The value of expression2 is used to specify which substring of the toggle string is wanted. The result is the substring.
*TOGGLESTRING(DATA_TYPE) | If the specified data type for the given command is of type toggle string, the full toggle string is returned.
*TOGGLEVALUE(DATA_TYPE) | If the specified data type for the given command is of type toggle string, the index number (or toggle value) of the toggle string is returned.
*TOL(<expression1>, <expresion2>, <expression3>, <expression4>) | Expression 1 is the string being colored. Expression 2 is the test value, Expression 3 is the plus tolerance, and Expression 4 is the minus tolerance. If the test value is in tolerance (Between the values for Expression 3 and Expression 4), then the current marked color from the color tree is used. Otherwise, the Error color (usually red) is used as the color for the text.
TOTALPAGEDIMCOUNT("CadReportObjectID") | This function contains one parameter. If it is empty (nothing between the quote marks), this returns the total number of dimensions in the current page. If you type the ID of a CadReportOjbect in the parameter, PC-DMIS returns the total number of dimensions associated with that CadReportObject. For example, if you used this expression =TotalPageDimCount("CadReportObject3") then PC-DMIS would return the total number of dimensions associated with CadReportObject3. You can also calculate the number of dimensions that contain a specific number of axes by appending ":N" to the ID, where N is a number representing the number of axes. For example, typing =TotalPageDimCount("CadReportObject1:4") would return the total number of dimensions associated with CadReportObject1 that contained at least 4 axes.
TOTALREPORTDIMCOUNT("CADREPORTOJECTID") | This function functions like the TotalPageDimCount() function with these important differences: Instead of returning the number of dimensions for the current page, it returns the total number of dimensions for the entire report. However it only works if there's a CADReportObject. If you have an object ID as your parameter, it needs to be named CADReportObject1.
TRACEFIELD(<expression>) | Displays the given tracefield's name and value in the report. The value of the expression is simply a number value representing the order of the listed tracefields from top to bottom in your part program. So to display the first listed tracefield, the code would read: =TRACEFIELD(1)
UNIT(<expression>) | Same as in PC-DMIS expression language.
*VARIABLE(<expression1>,<expression2>) | Displays the defined variable's value. This function takes one or two parameters. Expression1 is the string value representing the variable's ID. Expression 2 is an optional ID of another command ID or UID. See "Displaying a Variable's Value" for more information.
VECX(<expression>) | Same as in PC-DMIS expression language.
VECY(<expression>)
VECZ(<expression>)