APIs, concepts, guides, and more

◆ UnitsSet()

void UnitsSet ( LinearUnits units)
pure virtual
Description:
Sets your G-Code program to interpret linear distance in either inches or mm. Equivalent to including G20/G21 in your program.
Parameters
unitsMillimeters / Inches
Warning
Clears the current feed rate! You must set a feed rate in the new unit domain (via an F word or Gcode::FeedRateSet) before any feed-governed motion (G1/G2/G3) can occur. This is true even if units do not actually change (e.g., G20 when units are already inches). Because of this, you cannot have G20/G21 on the same line as a feed-governed move.
Cannot be changed if the current path units are LinearUnits::None.
Note
Rotational axes always use degrees. Linear units do not apply.
See also
Gcode::UnitsGet, Gcode::FeedRateSet

Visit our Concept Page for more information.