& Construction

Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
& Manufacturing

Professional CAD/CAM tools built on Inventor and AutoCAD
Integrated BIM tools, including Revit, AutoCAD, and Civil 3D
Professional CAD/CAM tools built on Inventor and AutoCAD
Autodesk Support
Nov 18, 2021
This article is intended to be used as a reference guide for creating advanced parameter expressions.
To get to the expression editor, right-click a manufacturing property and choose ‘edit expression’
AN IMPORTANT THING TO REMEMBER IS, EXPRESSIONS ARE CASE SENSITIVE!
Expressions can be set to other parameters within the active dialog by simply typing the parameter name in the expression dialog.
To copy a parameter name, you can right-click on any input field and choose 'Copy parameter name'
To find a parameter name, you can hold SHIFT then hover over a dialog
Units
Units are used within expressions, so it is important to ensure you type the correct unit after your desired value so that it's correctly evaluated. Without specifying a unit, expressions will be based on the document units and could give undesirable results, for example:
2mm instead of 2
5.2mm instead of 5.2
1in instead of 1
In a lot of cases, users would like to put some logic around an expression that will change the value based on the result of a specific condition (known as an IF statement). This is possible in expressions and is formatted as follows:
Condition ? what happens when True : what happens when False
Below are some examples of conditions
tool_diameter > 5
stepover == 1
tolerance <= 0.02
These conditions can then be placed inside of an expression that gives an outcome based on the result. Here are some examples:
tool_diameter > 5 ? 2mm : 1mm
stepover == 1 ? 0.1mm : 0.2mm
tolerance <= 0.02 ? 1mm : 3mm
Condition / operator | Meaning |
---|---|
value1 == value2 | Check to see if the values are equal to each other |
value1 != value2 | Check to see if the values are different from each other |
value1 > value2 | Check if value1 is greater than value2 |
value1 < value2 | Check if value1 is less than value 2 |
value1 >= value2 | Check if value1 is great than or equal to value2 |
value1 <= value2 | Check if value1 is less than or equal to value2 |
Multiple conditional statements
If you would like to use multiple conditions in one statement, they can be simply nested like the examples below:
Condition ? (Condition2 ? True2 : False2) : False
In the above case, condition2 would be run if condition1 is TRUE (and the result of condition2 would then be used)
or
Condition ? True : (Condition2 ? True2 : False2)
In the above case, condition2 would be run if condition1 is FALSE (and the result of condition2 would then be used)
In many cases, you may want to use mathematical functions within your expressions (such as rounding numbers, getting the sin/cosine of a value). This can be done using the following functions:
Function | Input 1 | Input 2 | Description |
---|---|---|---|
Math.maximum(input1, input2) | Number | Number | Returns the lowest of the two input values |
Math.minimum(input1, input2) | Number | Number | Returns the highest of the two input values |
Math.sqrt(input1) | Number | N/A | Returns the square root of the input value |
Math.sin(input1) | Number (Radians) | N/A | Returns the sine of the input radian value |
Math.asin(input1) | Number | N/A | Returns the inverse sine of the input radian value |
Math.cos(input1) | Number (Radians) | N/A | Returns the cosine of the input radian value |
Math.acos(input1) | Number | N/A | Returns the inverse cosine of the input radian value |
Math.tan(input1) | Number (Radians) | N/A | Returns the tangent of the input radian value |
Math.atan(input1) | Number | N/A | Returns the inverse tangent of the input radian value |
Math.floor(input1) | Number to round | N/A | Round the input value down to the nearest integer |
Math.floorto(input1, input2) | Number to round | Decimal step size (0.01 will round down to 2 decimal places) | Rounds the number down to the nearest specified decimal place |
Math.ceil(input1) | Number to round | N/A | Round the number up to the nearest integer |
Math.ceilto(input1, input2) | Number to round | Decimal step size (0.01 will round up to 2 decimal places) | Rounds the number up to the nearest specified decimal place |
Math.round(input1) | Number to round | N/A | Rounds the specified number |
Math.roundto(input1, input2) | Number to round | Decimal step size (0.01 will round to 2 decimal places) | Rounds the number to the nearest specified decimal place |
Math.roundToSignificant(input1, input2) | Number to round | Number of digits required | Rounds the number to the number of specified digits |
Math.normalizeAngleDegrees(input1) | Number (degrees) | N/A | Returns the input degree value to its equivalent within the 0-360 range |
Math.isnan(input1) | Any value | N/A | Returns TRUE if the input value is not a number and FALSE if it is a number |
Math.abs(input1) | Number | N/A | Returns the absolute value of the inputted value |
Half of the tool diameter:
tool_diameter / 2
80% of the flute length
tool_fluteLength * 0.8
Smallest of either the tool diameter or 12mm
Math.min(tool_diameter, 12mm)
Calculate the flat area of a 'bull nose' tool
tool_diameter - (2 * tool_cornerRadius)
Cusp height calculation for ball nose tool (change 0.666 to your desired cusp height)
Math.sqrt((tool_diameter/2)^2 - (tool_diameter/2 - 0.666)^2) /2
Step over based on the tool (if it's a face mill, use 95% of diameter, if it's not, use 40% of the diameter
tool_type == 'face mill' ? tool_diameter * 0.95 : tool_diameter * 0.4
Was this information helpful?
The Assistant can help you find answers or contact an agent.
What level of support do you have?
Different subscription plans provide distinct categories of support. Find out the level of support for your plan.
How to buy
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © 2025 Autodesk Inc. All rights reserved