define — Parametric operation (subprogram)Program & flow

Define a reusable, typed, defaulted operation — then call it by name.

define <name>(<p>: <unit> [= <default>], …) { … }   ·   <name>(<p>=<value>, …)

Equivalents: Fanuc M98 / G65 · Siemens CALL / L

ParameterTypeDefault
nameidentoperation name
ptyped paramdimensionally-checked parameter, optional default

The native answer to subprograms — and a step beyond. Parameters are **dimensionally type-checked** (`slot(len=40)` is rejected if `len` is a length without a unit), can have **defaults**, and an axis can be driven by a parameter expression (`x=<param>`). The HMI lists defined ops in a palette and generates a **conversational call dialog** from the typed signature, with a live toolpath preview.

a parameterised slot
define slot(len: mm, depth: mm = 3mm, feed: mm = 300) {
  g1 z=-depth f=feed
  g1 x=len
  g0 z5
}
slot(len=40mm, depth=5mm)

See also: let

← all commands