Docs › Command line › post
post
Generate a project's toolpaths, write the file its machine's controller reads, and check that file before it's saved. This is the app's Export, from the command line.
Synopsis
nativecam-cli post <project.nativecam> [-o out] [--air-cut height]
[--sheet out.html] [--force]
Description
- Reads the project and generates its toolpaths, exactly as the app does, and prints the job checks: cuts into the spoilboard or a clamp, depth beyond flute length, travel limits, chip loads and so on.
- Posts the toolpaths with the post for the project's machine: one of the built-in controller posts, or the Vectric post saved in the project.
- Reads each posted file back and checks it against the controller's rules, against the toolpaths move by move, and against the machine's travel. See export checks for the full list.
- Writes the file (or files) and prints a summary with the run-time estimate.
If the checks find an error, the G-code isn't written and the command exits with status 1, unless you pass --force.
Options
| Option | Description |
|---|---|
-o <path> | Where to write. The extension is replaced with the controller's, so -o out and -o out.tap both write out.tap for Mach4 or out.nc for Grbl. Default: the project's path and name. |
--air-cut <height> | Write an air cut instead: the same program with every Z, the safe height and the park height raised by height, with X and Y unchanged and a comment at the top. The height is in the G-code's units (inches for an inch machine) and must be above zero. The file name gets (air cut). |
--sheet <path> | Also write a printable HTML setup sheet: machine, material and zero, tools in loading order, the run order with tool changes and times, clamps, and any open checks. It's written even when the G-code fails its checks. Example. |
--force | Write the G-code even if the checks found errors. The errors are still printed. |
Output
Job checks print first, then any checks on the posted file, then a summary:
$ nativecam-cli post demo.nativecam -o demo.tap
[info] Drill mounting holes: Cuts through the material (0.0200 in into the spoilboard).
[info] Cut out sign: Cuts through the material (0.0200 in into the spoilboard).
Generated 4 toolpaths in 0.01s, 893 lines -> demo.tap
Estimated run time: 0:06:54 (cutting 0:05:30, rapids 0:00:24, tool changes/pauses 0:01:00; distance/feed alone: 0:06:26)
V-carve title: 0:01:26
Pocket plaque: 0:02:18
Drill mounting holes: 0:00:19
Cut out sign: 0:01:48
- Generated: the number of toolpaths, how long generating them took, the total line count and the files written.
- Estimated run time: timed with a model of the controller's motion planner (accelerations, corner speeds, look-ahead), split into cutting, rapids, and tool changes and pauses. distance/feed alone is the naive estimate, for comparison. Then the time for each toolpath. No estimate has been timed against a real machine yet.
One file per tool
Stock Grbl can't stop for a tool change, so unless the project names a sender that pauses on M6 (or a tool changer), a job with several tools is split into one file per tool. ShopBot without a tool changer, RichAuto, and Vectric posts with no tool-change block do the same. The summary lists every file:
$ nativecam-cli post sign-grbl.nativecam
[info] Drill mounting holes: Cuts through the material (0.0200 in into the spoilboard).
[info] Cut out sign: Cuts through the material (0.0200 in into the spoilboard).
[info] Grbl can't stop for a tool change here, so this job is saved as 2 files, one per tool. Change the bit and re-zero Z before running each. (If the program that sends your files pauses on M6, name it under Machine ▸ Sends files with.)
Generated 4 toolpaths in 0.01s, 894 lines -> sign-grbl 1 of 2 - T5.nc, sign-grbl 2 of 2 - T1.nc
Estimated run time: 0:07:22 (cutting 0:05:45, rapids 0:00:37, tool changes/pauses 0:01:00; distance/feed alone: 0:06:34)
V-carve title: 0:01:34
Pocket plaque: 0:02:25
Drill mounting holes: 0:00:28
Cut out sign: 0:01:50
Checks on split files are tagged with the file they came from, for example G-code 2 of 2 - T1:.
Air cut and setup sheet
$ nativecam-cli post demo.nativecam --air-cut 1 --sheet demo-sheet.html
[info] Drill mounting holes: Cuts through the material (0.0200 in into the spoilboard).
[info] Cut out sign: Cuts through the material (0.0200 in into the spoilboard).
Setup sheet -> demo-sheet.html
Generated 4 toolpaths in 0.01s, 894 lines -> demo (air cut).tap
Estimated run time: 0:06:54 (cutting 0:05:30, rapids 0:00:24, tool changes/pauses 0:01:00; distance/feed alone: 0:06:26)
...
The demo's machine posts in inches, so --air-cut 1 raises the program 1 inch. Make sure Z can rise that far above your safe height.
When the checks fail
Errors from the checks on the posted file are printed as [error] G-code: … lines, and the command stops without writing G-code:
The G-code failed its checks, so it wasn't written. Fix the errors above, or pass --force to write it anyway.
# exit status 1
A project whose controller NativeCAM has no post for stops with the reason, for example NativeCAM can't write G-code for UCCNC yet…, and the same status.
Exit status
| Status | When |
|---|---|
0 | The files were written. Warnings don't change this. |
1 | No project path, a project that can't be read, an --air-cut height that isn't above zero, no post for the machine, a file that can't be written, or G-code that failed its checks without --force. |
See also: sim to simulate the result, and checking projects in CI.