Docs menu: template

Docs › Command line › template

template

Save a project's toolpaths as a toolpath template, or add a template's toolpaths to another project, as Toolpaths ▸ Save Toolpaths as Template… and Toolpaths ▸ Apply Template do in the app. The templates tutorial covers layers, vector binding and depths.

Synopsis

nativecam-cli template save <project> -o <out.nativecamtemplate> [--no-setup]
nativecam-cli template apply <template> <project> [-o out.nativecam | --in-place] [--setup] [--tools library.json]

Options

OptionWhat it does
save … -o <file>Required. Saves all the project's toolpaths, in run order, with their tools and settings. The template's name is the file name without its extension.
--no-setupLeaves the job setup out of the template. By default it's saved: the material, its thickness, the XY and Z zero, the heights and the machine.
apply … -o <file>Where to write the project with the template's toolpaths added. Without -o it's saved beside the project as project + template.nativecam (… 2.nativecam and so on if that's taken), and the project itself is left alone.
--in-placeOverwrites the project instead. It can't be used with -o: Pass -o or --in-place, not both.
--setupUses the template's job setup, and prints each change it makes.
--tools <library.json>Matches the template's tools against this NativeCAM tool library instead of the starter library.

Saving

Each toolpath is listed with how it will find its vectors when the template is applied:

$ nativecam-cli template save "Workshop Sign.nativecam" -o "Workshop sign.nativecamtemplate"
Saved 4 toolpaths to Workshop sign.nativecamtemplate (format 1)
  V-carve title: Layer “V-Carve”
  Pocket plaque: Layer “Pocket”
  Drill mounting holes: Layer “Holes”
  Cut out sign: Layer “Cut Out”

The format is the project file format the toolpaths need. A template saved by a newer NativeCAM than the one reading it is refused.

Applying

The template's toolpaths go after the project's own. Each line says what a toolpath found, then each tool and whether it's in the library, then the material thickness and how many toolpaths found nothing:

$ nativecam-cli template apply "Workshop sign.nativecamtemplate" "Open Sign.nativecam" -o "Open Sign applied.nativecam" --setup
  V-carve title: Layer “V-Carve”: 1 vector
  Pocket plaque: Layer “Pocket”: 0 vectors, added empty
  Drill mounting holes: Layer “Holes”: 2 vectors
  Cut out sign: Layer “Cut Out”: 1 vector
  T5 60° V-Bit 1/2": in the library
  T1 1/4" Upcut End Mill: in the library
  Thickness: 0.5000 in → 0.7500 in
  Z zero: Spoilboard → Material top
Material 0.7500 in; 1 toolpath found no vectors
Wrote Open Sign applied.nativecam

When every toolpath finds something, the last line but one says so: Material 0.7500 in; every toolpath found its vectors.

  • A toolpath that finds no vectors is still added, empty, and the exit status is still 0. post then warns about it: [warning] Pocket plaque: No vectors on layer “Pocket”. …
  • A tool the library doesn't have is listed as not in the library, and one renumbered because another bit has its number says which number it had in the template.
  • The job-setup lines appear only with --setup. Without it, Through and Thickness − depths follow the project's own thickness. The machine is never changed; a line says when the template was made for another one.
  • A template that can't be read, or is from a newer NativeCAM, stops the command with exit status 1: Can't read template future.nativecamtemplate: This template was saved by a newer version of NativeCAM (format 99). Update NativeCAM to use it.