Machine Selection

Before exporting, select the machine controller that will run the G-code. The machine selection determines the post-processor — the dialect of G-code, units, and header/footer format that the output uses.

Select the Project node in the feature tree. In the properties panel, find the Machine dropdown and choose your controller.

Built-in machine definitions include Grbl, LinuxCNC, and Mach3. You can also add custom machine definitions by clicking Add machine and providing a JSON definition file.

Clearance Settings

The following project-level settings affect the generated G-code:

SettingDescription
Safe ZThe Z height for rapid moves between operations. The tool retracts to this height before any rapid traverse.
Op Clear ZThe Z height for rapid moves within an operation (between passes and between features).
Clamp Clear XYHorizontal clearance around clamp boundaries.
Clamp Clear ZAdditional Z clearance above clamp height on rapid moves over clamps.

Export Dialog

Click Export in the CAM panel (or use the keyboard shortcut) to open the Export dialog. The dialog shows:

  • A preview of the generated G-code with syntax highlighting.
  • The selected machine and post-processor.
  • A summary of the operations that will be included.

Review the G-code preview before downloading. When it looks correct, click Download to save the .nc file.

screenshots/cam-export-dialog.png
Export dialog showing G-code preview and download button
Always verify before cutting. Review the G-code in your machine controller's toolpath display or run a dry cycle with the spindle off before making contact with material.

What Gets Exported

Only operations that are both enabled and have their toolpath visible are included in the G-code export. Operations with Enabled unchecked are skipped entirely.

Operations are exported in the order they appear in the operations list. Reorder them by dragging in the CAM panel before exporting.

Features that are hidden in the feature tree are excluded from toolpath calculations and therefore from the export.

Custom Machine Definitions

If your machine controller is not in the built-in list, you can add a custom definition. Click Add machine in the Project properties panel and select a JSON file containing the machine definition.

Download the template below as a starting point, edit it to match your controller, then load it into the project:

Download machine-definition-template.json

Field Reference

FieldDescription
idUnique identifier string. Must not clash with built-in IDs (generic, grbl, mach3, linuxcnc).
nameDisplay name shown in the Machine dropdown.
descriptionShort description shown in the UI.
vendorOptional vendor name.
builtinMust be false for custom definitions.
fileExtensionOutput file extension, e.g. nc, tap, gcode.
coordinateSystemMaps internal X/Y/Z axes to machine axes. Use -X etc. to invert an axis.
numberFormat.decimalPlacesDecimal places for coordinates. Can be a single number or separate mm/inch values.
numberFormat.trailingZerosWhether to pad numbers with trailing zeros.
numberFormat.leadingZeroWhether to include the leading zero on numbers less than 1.
units.mmCommandG-code command to select millimeter mode, e.g. G21. Set to null to omit.
units.inchCommandG-code command to select inch mode, e.g. G20. Set to null to omit.
program.headerArray of lines emitted at the start of the file. Supports tokens: {programName}, {date}, {unitsCommand}, {wcsCommand}.
program.footerArray of lines emitted at the end of the file.
program.commentPrefix / commentSuffixCharacters that wrap comments, e.g. ( and ) for Mach3, or ; and for inline comments.
program.lineNumbersWhether to prefix each line with a line number (N10, N20, …).
workCoordinates.selectCommandWork coordinate system command, e.g. G54. Set to null to omit.
motion.arcFormatij for center-offset arc format (most controllers), or r for radius format.
motion.modalMotionIf true, the motion command (G0/G1) is omitted when it hasn't changed since the last move.
feedSpeed.inlineWithMotionIf true, F and S words are emitted on the same line as the motion command.
feedSpeed.modalFeedSpeedIf true, F and S are omitted when unchanged.
toolChange.commandsArray of lines emitted on a tool change. Supports {toolName} token.
cannedCyclesDrill cycle commands. Set to null if your controller does not support canned cycles — drilling will fall back to explicit G0/G1 moves.
coolantCoolant on/off commands. Set to null if not used.
stop.programEndCommandCommand emitted at the very end of the file, e.g. M30 or M2.

Custom machine definitions can be removed by selecting the machine in the dropdown and clicking Remove machine. Built-in definitions cannot be removed.

Click Refresh (the refresh icon next to the Machine dropdown) to reload machine definitions if you have updated a definition file externally.