Documentation
Parameters and expressions
Every dimension has a name, and every number field accepts an expression that can use those names and your own user parameters. Change a parameter in the Parameters dialog and every sketch and feature that depends on it is rebuilt.
How are dimensions named?
Each dimension gets a name when it is made, d1, d2 and so on in the order of the design. Rename it in the Parameters dialog to something you will recognise, such as width. When you are typing a value into a dimension, click another dimension to insert its name.
How do I make a user parameter?
Open Parameters from the toolbar (or press S and type “parameters”) and add one with a name, a unit, an expression and a comment. Faster still: type Width = 60 into a dimension’s value box. That creates the user parameter Width with the value 60 and makes the dimension use it.
Where can I write an expression?
- In any sketch dimension. The dimension then shows
fx:before its value. - In every number field of a feature: extrude distance, fillet radius, hole diameter, pattern count, spacing and angle, and the rest. A field holding an expression shows it in italics.
- In the offsets and angles of construction planes, axes and points.
If you drag a feature’s handle, the field’s expression is replaced by the number you dragged to. A field whose expression cannot be read turns red, and the feature is not rebuilt with a guess.
What can an expression contain?
Numbers, names, + - * / ^, % for the remainder, brackets and functions. Expressions follow the rules parametric CAD programs share, so formulas you already know work the same way:
| Write | Means |
|---|---|
Width + 2*Wall | the sum of two parameters, in the field’s unit |
12.7 mm, 0.5in, 3/8in | a length in any unit; 3/8in is 9.525 mm |
1in + 2 | the 2 is in the design’s own unit |
30deg, 0.5rad | angles; a plain number in an angle field is in degrees |
10*sin(30deg) | 5: sin, cos and tan take angles |
asin(0.5) | 30°: asin, acos and atan give angles |
max(a; b) | function arguments are separated by ; or , |
round(2.5) | 3: halves round away from zero |
log(100), ln(E) | 2 and 1: log is base 10, ln is natural |
Other functions: sqrt, abs, min, floor, ceil, sign, hypot, exp, pow, atan2 and the hyperbolic functions. PI and E are constants. Units are checked: a length times a length is an area, so it is refused in a length field.
What does the Parameters dialog show?
Your user parameters, each with its unit, expression, current value and comment, and below them every sketch’s dimensions, grouped by sketch, which you can rename and give expressions. Change any value and everything that uses it is recalculated in dependency order, the sketches solved again and the model rebuilt.
What keeps parameters consistent?
- A circular reference (
a = b + 1andb = a - 1) is refused. - Renaming a parameter rewrites every expression that uses it.
- A parameter that an expression still uses cannot be deleted.
How do templates use parameters?
A template’s geometry is driven by a few named parameters, such as thickness for a laser-cut box, so changing one number in the dialog resizes the whole design. See the template library and Laser and CNC.