Skip to content

Units and expressions ​

Every value field in Moket accepts an expression: a number, a parameter, or a formula.

Units ​

UnitKind
mmLength
cmLength
mLength
inLength
ftLength
degAngle
radAngle

A number without a unit uses the part's units (see Units, materials and properties). Units can be mixed: 1 in + 5 mm works.

Operators and functions ​

ItemExample
+, -, *, /width / 2 - 5 mm
^ (power)side ^ 2
Parentheses(width - 2 * margin) / 3
pi2 * pi * r
sqrt, abs, floor, ceil, roundround(width / 30)
min, max (two or more values)max(5 mm, thick / 2)
sin, cos, tancos(30 deg) * length
asin, acos, atan, atan2atan2(h, w)

Names ​

An expression uses the part's parameters by name (width / 2) and the project's parameters as project. and the name (project.axisZ - 10 mm). See Share sizes across a project.

Checking ​

The field checks the expression as you type and shows its value. Units must fit: a length cannot go where an angle is needed, and mm + deg is refused. An unknown name or an expression that refers to itself is refused too; nothing changes until the expression is valid.

Moket Help