DOCS / HOW-TO GUIDES / FURNITURE
Use project parameters and expressions
A project parameter is a named value, for example wardrobeWidth = 2350. Generated assemblies (a carcass, a stud frame, joists) can use the name in their parameters. When you change the value, every assembly that uses it is built again.
To see an example, open File ▸ Sample projects ▸ Bookcase. Its width comes from the parameter bookcaseWidth.
Add a parameter#
- Click an empty part of the viewport, so that nothing is selected.
- In the Properties panel, find the Parameters heading.
- In the field with the text "name = expression", type the parameter, for example
shelfDepth = 280. - Press Enter.
The name must start with a letter or _, and can contain only letters, digits and _. The Parameters list shows each value after =.
Use it in a generated assembly#
- Select the generated assembly.
- In the Properties panel, under Parameters, type the name in a length field, for example
shelfDepth. - Press Enter.
The field keeps the name, and the value it gives shows after =.
Write an expression#
A parameter, or a length field of a generated assembly, can hold an expression:
| You type | Value |
|---|---|
2350 | 2350 mm |
2.35m | 2350 mm |
90cm | 900 mm |
36in | 914.4 mm |
8ft | 2438.4 mm |
wardrobeWidth / 3 | a third of wardrobeWidth |
(roomWidth - 20) / 2 | half of roomWidth less 20 mm |
round(wardrobeWidth / 3, 5) | a third, rounded to the nearest 5 mm |
Numbers with no unit are mm. The operators are +, -, *, / and brackets. The functions are min, max, round, floor, ceil, abs and sqrt. round, floor and ceil take an optional step as the second value.
Change or delete a parameter#
- To change a parameter, type a new expression in its field and press Enter.
- To delete a parameter, click ✕ beside it.
You cannot delete a parameter that something still uses. If a parameter uses itself through other parameters, KerfCraft shows "Circular dependency" and the chain of names.