Share

IF - ELSE statement

The IF - ELSE statement executes a series of commands when a certain condition is met and a different series of commands otherwise.

The basic control structure is:

IF <expression> {
    Commands A
}   ELSE {
    Commands B
}
    Commands C

If expression is true, then Commands A are executed followed by Commands C.

If expression is false, then Commands B are executed followed by Commands C.

image

// Set tool axis lead/lean if tip radiused tool
// Otherwise use the vertical tool axis.
IF active(Tool.TipRadius) OR Tool.Type == "ball_nosed" {
    EDIT TOOLAXIS TYPE LEADLEAN
    EDIT TOOLAXIS LEAD "5"
    EDIT TOOLAXIS LEAN "5"
}   ELSE {
    EDIT TOOLAXIS TYPE VERTICAL
}

Was this information helpful?