Numeric Expression Examples Reference

When you edit dimensions, create offset work planes, and edit offset constraints, you enter values in an edit box.

You also enter values in edit boxes in many dialog boxes as you create models. You can define or edit parameter names or values in edit boxes and use any of the recognized internal unit systems.

In an edit box, a correctly entered expression is shown in black. Invalid or unrecognized syntax is shown in red.

Keep in mind unit conventions, the correct order of algebraic order of operations and operator precedence. In all expressions, the returned unit type must match one of the expected unit types. For example, a sweep length would expect mm, in, cm, or any other valid length unit. An expression that returned a value having radian units for a sweep length would create an error.

Tip: An edit box assumes default units based on context and system units. However, for best results, include units for every term and factor in the expression. Use "ul" for unitless terms.

The following examples are shown in default units.

Define parameter name and value
Add two values to create the parameter DIST. The equal sign separates the parameter name from the value. Inventor parses the expression to create the parameter DIST and assign it the value of the equation.

DIST = (4 mm + 25.4 mm)

Use mixed units (inches, degrees)
Assume that the default units are inches and degrees. To enter an expression with mixed units, use conversion factors in the expression.

(2 in + 4 mm * 1 in / 25.4 mm)

Use internal parameters (radians)
Inventor keeps internal values for commonly used parameters such as PI = 3.14159265359 and e = 2.718281828459. Just substitute these parameters for the values when you need them in your expressions.

(PI rad/ 4ul + (35 deg * PI rad / 180 deg))

Use built-in functions (inches, degrees)
The edit box is equipped with built-in functions that algebraically combine with other values and parameters to create complex expressions. Here, the inverse tangent function is used to calculate an angle from the ratio of part sides.

30 deg + atan(4 in / 3 in)

Use unitless values (mm, degrees)
To represent values with no units, use the symbol "ul" in edit boxes. Although Inventor correctly interprets unitless values, such as the expression 3 * (3^2) where the default length is mm, use an unambiguous method instead:

3 mm * ((3 ul) ^ 2 ul)

Use fractional input strings (feet, inches)
Fractional input strings are retained in the edit box when the input units are imperial units (for example 10’-6 1/2”). If the display units are a type of imperial units (feet or inches), the parameter value is displayed in the graphics window as a fraction. If the display units are metric units, the value is displayed in the graphics window as a decimal.

If the display units are feet or inches, there are additional options in the edit boxes. The display type of the parameter. The options are Inferred, Decimal, Fractional, and Architectural. The Inferred option sets the unit type based on the input string and displays the type in parentheses. The Architectural option uses ‘ and “ in the parameter (10’-6 1/2”).

When entering units in this format, the single quotation mark (‘) and double quotation mark (“) are required. If the quotation marks are not used, the expression will be evaluated as an equation and the fraction format will not be maintained. You can use a dash (-) or a space to separate the feet and inches values.