Introduction
The Bantam Tools NextDraw Command Line Interface is an application programming interface (API) for using the Bantam Tools NextDraw™ from either the command line interface (CLI) or within shell scripts and other environments that make use of shell commands.
The primary function of this software is to plot SVG documents. How to do so is described below, beginning at Quick start.
While this software is designed as a "stand alone" utility, it is written in Python. If you would like to control the NextDraw from within your own Python script, please see the separate API documentation for the Bantam Tools NextDraw™ Python API. (As a side note, the Python API supports an additional control method: interactive XY motion control through "moveto/lineto" type commands and vertex lists.)
The Bantam Tools NextDraw™
The Bantam Tools NextDraw™ drawing and handwriting machine is the proven and reliable compatible computer-controlled plotter that provides versatile solutions to artists, innovators and educators.
The Bantam Tools NextDraw™ is designed and manufactured by Bantam Tools in Peekskill, New York.
For general information about getting started with and operating the machine, please see our extensive PDF user guide, available here.
Please also see the central documentation site for the Bantam Tools NextDraw; many additional resources are listed there.
NextDraw owners may request technical and other product support by contacting us directly through our contact form, or discord chat.
Installation
One line install
If you already have Python installed (versions 3.9 - 3.13), use the following in a terminal:
python -m pip install https://software-download.bantamtools.com/nd/api/nextdraw_api.zip
This procedure installs both the NextDraw CLI and the NextDraw Python Module. The link is permanent and will be kept up to date. The current release version is 1.5.0.
If you use this method, you may also want to download the zip file conventionally, since the download includes example python scripts, an example configuration file, an example SVG file, and instructions for un-installing the software.
Alternate install
Download the API from this permanent link The current release version is 1.5.0.
Please see Installation.txt included with the download for full installation instructions.
(Abbreviated instructions: Install Python 3. Unzip the archive, move into the directory, and use python -m pip install . to install the software.)
Upgrading
If you already have this software installed, we recommend the following method to upgrade:
python -m pip install https://software-download.bantamtools.com/nd/api/nextdraw_api.zip --upgrade --upgrade-strategy eager
Quick start
Quick startTypical usage, to plot a file:
nextdraw FILE_NAME [OPTIONS]Example 1: Plot a file named NextDraw_trivial.svg
nextdraw NextDraw_trivial.svg
Example 2: Plot a file named input.svg, and collect the output SVG
nextdraw input.svg -o output.svg
The output is saved as a file, called output.svg
Alternate syntax:
python -m nextdraw FILE_NAME [OPTIONS]
The code examples here show the basic syntax for plotting an SVG file.
In addition to plotting a file, the API includes the ability to set a wide range of configuration options as well as a smaller number of utility functions.
A file input is required syntax for most operations. Certain utility modes that do not perform any plotting do allow the file input to be omitted.
By default, no output SVG is returned as part of the plotting process.
However, in some situations it may be use useful to have the program generate and
return an output SVG file using the output_file flag.
Saving the output SVG allows the capability to pause and subsequently resume a plot in
progress, or to preview a plot. See further discussion under res_plot and
no_render below.
A plot underway can be paused by pressing the physical pause button on the NextDraw or by using Control+C on your keyboard.
Special commands
The following "special" commands have independent syntax and do not require an input file name to be specified:
Show quick helpnextdraw --help
Display software version of NextDraw software and its CLI wrappernextdraw --versionornextdraw version
Additionally, the following modes (which do not plot) do not require an input file,
unless an output file is specified:
cycle, align,
utility, sysinfo, version.
Setting options
CLI Syntax
CLI SyntaxOne or more options may be specified with the following syntax:
nextdraw FILE_NAME --option_name value
Example 1: Plot file.svg, with maximum pen-down speed of 50%, acceleration 80%:
nextdraw file.svg --speed_pendown 50 --accel 80
Example 2: Use utility mode with the utility command to disable the XY motors (this command does not require an input file):
nextdraw --mode utility --utility_cmd disable_xy
Example 3: Shell commands also have short forms, like this equivalent:
nextdraw -m utility -M disable_xy
Example 4: Simulate plotting a file, generating a rendered preview of all motion, making use of the output file (-o) option, and saving the output file "outputfile.svg":
nextdraw file.svg -v -o outputfile.svg
Most plotting options can be set using CLI arguments.
For arguments that do take a value, specify only one value for each argument.
Each option also has a "short" single-character version. Short options can be combined together with their value without a space in between. You can also combine together multiple short (single-character) options together, so long as only the last option has a value.
Defaults and Precedence
The various options and their values are detailed in the sections below. For options that you do not directly specify, the default value will be used.
The default value of most options are set from within the nextdraw_conf.py configuration file within the files installed by the API. These include the pen up and pen down heights, basic speed settings, and so forth. The configuration file also includes additional parameters and defaults that are only set in configuration files and do not have any equivalent that is accessible through command line arguments.
An example configuration file can be in the API download at:
examples_config/nextdraw_conf_copy.py
You can duplicate, move, rename, and edit this file as needed, though you should keep the ".py" file extension. You may wish to use different configuration files to have quick settings ready for (for example) draft versus final plotting speeds, different size NextDraw models, different paper size limits, which particular NextDraw unit to plot to, or previewing without plotting. Configuration files do not need to be as complex as the example file; it is perfectly reasonable to use a configuration file that specifies even just a single option value.
A few specific options (including pen up/down heights, and plotting speed) can also be set by encoding these settings into the SVG file. The mechanism for doing this is called "NextDraw Layer Control", and it involves using special escape codes in the name of the layer(s) in the SVG file. Several additional commands such as timed delays and forced pauses can be controlled through this mechanism as well.
The order of preference for options and parameters is as follows:
1: Options and values values specified in the SVG file (as in, by layer names) overrule those specified either by the command line or in your configuration file.
2: Options and values specified on the command line argument overrule those in your configuration file.
3: Options and values given in a specified configuration file overrule those in the default nextdraw_conf.py configuration file.
Note that each time you call nextdraw, you are creating an independent NextDraw session that works from default values and those that you specify. Settings are not preserved between invocations of it. For example, if you run a plot with a certain speed setting specified on the command line, subsequent plots will use the default speed unless you specify otherwise.
As an aside, if you do also use Inkscape for plotting SVG files, please note that option values and settings that you select from within the Inkscape GUI are not consulted and do not affect plotting from outside Inkscape.
Options
The following is a list of optional arguments that can be applied. Each of these arguments will be described individually, after the list.
| Option | Description |
|---|---|
--mode, -m |
Specify general mode of operation. |
--config, -f |
Specify configuration file to use. |
--progress, -b |
Enable progress bar while plotting. |
--handling, -z |
Specify handling mode for motion. |
--speed_pendown, -s |
Maximum XY speed when the pen is down (plotting). |
--speed_penup, -S |
Maximum XY speed when the pen is up. |
--accel, -a |
Relative acceleration/deceleration speed. |
--pen_pos_down, -d |
Pen height when the pen is down (plotting). |
--pen_pos_up, -u |
Pen height when the pen is up. |
--pen_rate_lower, -r |
Speed of lowering the pen-lift motor. |
--pen_rate_raise, -R |
Speed of raising the pen-lift motor. |
--no_rotate, -N |
Disable auto-rotate; preserve plot orientation. |
--report_time, -T |
Report time and distance after the plot. |
--utility_cmd, -M |
Specify which utility-mode command to use. |
--dist, -w |
Distance input for certain utility commands. |
--layer, -l |
Specify which layer(s) to plot in the layers mode. |
--copies, -c |
Specify the number of copies to plot. |
--page_delay, -D |
Specify delay between pages, for multiple copies. |
--preview, -v |
Perform offline simulation of plot only. |
--no_render, -g |
Disable rendering of motion in previews. |
--reordering, -G |
Specify level of plot optimization to use. |
--random_start, -Y |
Randomize start positions of closed paths. |
--hiding, -H |
Enable hidden-line removal. |
--model, -L |
Select plotter model. |
--penlift, -q |
Pen lift servo configuration. |
--no_homing, -n |
Disable automatic homing. |
--port, -p |
Specify a USB port or NextDraw to use. |
--port_config, -P |
Override how the USB ports are located. |
--output_file, -o |
Specify an output file name. |
--digest, -O |
Plot digest output option. |
--webhook, -W |
Enable webhook alerts. |
--webhook_url, -U |
URL for webhook alerts. |
mode
modeExample 1: Plot all layers that have a layer name beginning with the number 1:
nextdraw file.svg --mode layers --layer 1
Example 2: Cycle the pen down then up:
nextdraw -m cycle
Example 3: Disable the XY stepper motors, using "utility" mode:
nextdraw -m utility -M disable_xy
General mode of operation
Syntax: [-m, --mode] value
Specify the general mode of operation. This is equivalent to selecting a function "tab" in the Inkscape-based GUI for the Bantam Tools NextDraw software.
The following is a list of allowed values of the mode parameter. Each of these modes will be described in detail, after the list.
| Value | Description |
|---|---|
plot |
Plot the file. [DEFAULT] |
layers |
Plot a single layer (or set of layers), selected by layer option |
cycle |
A setup mode: Lower and then raise the pen |
align |
A setup mode: Raise pen, disable XY stepper motors |
find_home |
A setup mode: Perform automatic homing sequence |
utility |
Execute a utility command, specified by utility_cmd option |
sysinfo |
Query EBB firmware version and report system information |
version |
Report NextDraw software version number |
res_plot |
Resume a plot in progress, using stored plot progress data |
Modes that process or plot the file (plot, layers, res_plot)
always require a file input.
The other modes (align, utility, sysinfo, version)
do not require a file input unless an output file is specified with the
output_file option.
Default: 'plot', set in nextdraw_conf.py or your specified config file.
plot
mode: plotExample 1: Plot a file using default mode and options:
nextdraw file.svg
Example 2: The same, explicitly setting the mode:
nextdraw file.svg --mode plot
Example 3: The same, using short codes:
nextdraw file.svg -m plot
Plot the SVG file
Syntax: [-m plot, --mode plot]
The plot mode is for plotting an SVG file. This the default mode of operation, and generally does not need to be explicitly specified. An input file, to be plotted, is always required when in plot mode.
layers
mode: layersExample 1: Plot all layers that have a layer name beginning with the number 1:
nextdraw file.svg --mode layers --layer 1
Example 2: Render a preview of how a layer called "5-blue" (the only layer in file.svg that has a name starting with the number 5) will plot, including pen-up travel, and estimate how long that layer will take to plot. Save the output file as "output.svg":
nextdraw file.svg -m layers -vT -l5 -o output.svg
Plot a single layer (or set of layers)
Syntax: [-m layers, --mode layers]
Plot a single layer (or set of layers), selected by a layer argument.
When using the default (plot) mode, the entire document will be plotted. That is to say all paths, on all visible layers of the SVG document, will be plotted. You can instead use layers mode to plot a single layer or group of layers, for example to plot only layers that should be plotted in one color of ink.
If you plot in layers mode, only visible layers that have layer
names beginning with the selected number will plot. The selected number
is given by the value of the --layer option, and may be in the range
of 0 - 1000.
Plotting in this mode, with layer specified will plot only layers whose names begin with the selected number.
For example, a layer named "5-red" will be printed if the number 5 is selected, but a layer named "2-black" or "guide lines" will not be.
Layers mode is equivalent to plotting from the "Layers" tab of NextDraw Control within Inkscape.
An input file, to be plotted, is always required when in layers mode.
Sublayers and other named groups are not considered to be layers for this or
other software features that operate by layers; only "top-level" layers can be
addressed in layers mode.
For more information about options available based on layer name, and how to create layers when generating SVG outside of Inkscape, please see the NextDraw Layer Control documentation.
cycle
mode: cycleExample 1: Cycle the pen down and then up, using "cycle" mode:
nextdraw --mode cycle
Example 2: Cycle the pen down and then up, with pen-down and pen-up heights set to 20% and 80% respectively:
nextdraw --mode cycle --pen_pos_down 20 --pen_pos_up 80
Example 3: Cycle the pen down then up, with pen-down and pen-up heights set to 10% and 90% respectively and all short codes:
nextdraw -mcycle -d10 -u90
Cycle the pen down and back up
Syntax: [-m cycle, --mode cycle]
This is a setup mode that can be used used to prepare the NextDraw for use. It will lower the pen, wait 0.5 seconds, and then raise the pen. Cycling before inserting your pen ensures that your pen holder starts in the pen-up position, with current pen-up and pen-down heights applied.
Cycle mode is equivalent to selecting the "Setup" tab of the Bantam Tools NextDraw extension for Inkscape and choosing the "Cycle pen down then up" option within that tab.
An input file is not required in this mode unless an output file is specified
with the output_file option.
Execution of the command is typically faster without an input file.
If you wish to only lower or raise the pen, not cycle down and up, use the lower_pen/raise_pen utility commands instead.
align
mode: alignExample 1: Enter align mode:
nextdraw --mode align
Example 2: Enter align mode, setting the pen-up height to 85%:
nextdraw -malign --pen_pos_up 85
Raise pen and disable XY stepper motors
Syntax: [-m align, --mode align]
This is a setup mode that may be used used to prepare the NextDraw for use. It will raise the pen to the "pen up" position and turn off (disengage) the XY stepper motors. In this configuration, one can manually move the carriage to the home corner and insert a pen.
Note that the pen will only be raised if it was in the down state or indeterminate state. It will not be raised if it was already in the pen-up state.
This mode is equivalent to selecting the "Setup" tab of the
Bantam Tools NextDraw extension for Inkscape
and choosing the "Raise pen, turn off motors" option
within that tab. Both raising the pen and turning off the XY motors
are actions that can also be initiated in utility mode.
An input file is not required in this mode unless
an output file is specified
with the output_file option.
Execution of the command is typically faster without an input file.
find_home
mode: find_homeExample: Perform the automatic homing sequence (only).
nextdraw -m find_home
Perform automatic homing sequence
Syntax: [-m find_home, --mode find_home]
The find_home mode is a setup mode that begins the automatic homing cycle to move the
carriage to the Home position.
Automatic homing is enabled by default when you have selected a Bantam Tools NextDraw™
with the model option, and have not disabled it with the no_homing
option.
It is not usually necessary to use the find_home mode as a part of everyday operations,
since the machine will (automatically) perform the homing sequence when needed. This
mode is provided in case you should happen to have a reason to perform the automatic
homing sequence that is before or otherwise separated from the typical homing process.
This mode is equivalent to selecting the "Setup" tab of the Bantam Tools NextDraw extension (within Inkscape) and choosing the "Perform automatic homing" option within that tab.
An input file is not required in this mode unless
an output file is specified
with the output_file option.
Execution of the command is typically faster without an input file.
utility
mode: utilitySee examples for each individual utility_cmd item.
Execute a "utility" command
Syntax: [-m utility, --mode utility]
Execute one of several "utility" commands, specified with
the utility_cmd argument.
See the description of "utility_cmd" below for additional information about the available commands.
This mode is equivalent to selecting the "Utility" tab of the Bantam Tools NextDraw extension within Inkscape.
An input file is not required in this mode unless an output file is specified
with the output_file option. Note in particular that the
strip_data utility command has no effect unless both
an input and output file are specified.
sysinfo
mode: sysinfoExample 1: Request sysinfo:
nextdraw --mode sysinfo
Example 2: Request sysinfo using short code:
nextdraw -m sysinfo
Typical response to sysinfo request (example on Mac):
This is Bantam Tools NextDraw™ version 1.1.
Your software is up to date.
Your NextDraw has firmware version 3.0.2.
Your firmware is up to date; no updates are available.
Additional system information:
3.10.6 (main, Aug 30 2022, 04:58:14) [Clang 13.1.6 (clang-1316.0.21.2.5)]
Voltage readout: 296 (~ 9.08 V).
Current setpoint: 483 (~ 0.89 A).
Report system information
Syntax: [-m sysinfo, --mode sysinfo]
Query firmware version, check online for updates, and report additional system information. This mode is equivalent to selecting the "Version" tab of NextDraw Control within Inkscape.
The information items listed are:
- The firmware revision for the NextDraw's EBB control board.
- Whether a firmware update is available.
- The version number of the NextDraw software.
- Whether a software update is available.
- Detailed version information of the Python interpreter running the script, as given by Python's sys.version command.
- Estimated voltage input at the EBB, as well as motor current setpoint.
This is the only function in the NextDraw software that uses
an online connection, and it will only check for updates if
explicitly requested to with the "sysinfo" mode or the Version tab
within Inkscape. You can disable checking for updates (to fully
disable the online connection) by editing the
nextdraw_conf.py (or your specified configuration file)
and changing the value of check_updates to False.
An input file is not required in this mode unless an output file is specified
with the output_file option.
Execution of the command is typically faster without an input file.
version
mode: versionExample 1: Request version:
nextdraw --mode version
Example 2: Request version using short code:
nextdraw -m version
Typical response:
2.5.0
NextDraw Software Version
Syntax: [-m version, --mode version]
Query and report NextDraw software version. This mode is not available in the GUI (Inkscape) based version of this software.
An input file is not required in this mode unless an output file is specified
with the output_file option.
Execution of the command is typically faster without an input file.
res_plot
modes: res_plotExamples:
First, suppose that the NextDraw was paused during a plot that was called by the following command:
nextdraw file.svg -o temp.svg
This creates a "saved progress" output file called temp.svg.
To resume plotting, use the following command:
nextdraw temp.svg --mode res_plot
One may prefer to save a new output file, just in case one should wish to allow additional pause/resume events:
nextdraw temp.svg --mode res_plot -o temp2.svg
Resume a paused plot
Syntax: [-m res_plot, --mode res_plot]
It is possible to pause a plot underway, and save the progress of the
plot such that the plot can be resumed later. The res_plot ("resume plot")
mode allows you to continue working with a plot that has been paused with
progress saved.
Background: When using the Bantam Tools NextDraw extension for Inkscape, the following workflow is used to pause and resume plots that are underway:
- The plot is paused by pressing the physical pause button on the NextDraw, or using Control+C on the keyboard. (Plots can also be paused at predefined points with NextDraw Layer Control.)
- The plot pauses after finishing queued motion commands.
- The SVG file is updated, saving an index of progress through the file.
- The user may then use the Resume tab to resume the plot, using the stored plot progress data from the file as a reference.
The same basic procedure may be used through the CLI, if the updated version of the SVG file is saved as the output file, by specifying an output file name.
The res_plot mode can only be used if the file contains a
stored record of the progress through the file. This record is generated
automatically when a plot is paused, and included in the output SVG file.
The position that a plot will be resumed at can be read and set by the
res_read and
res_adj_in/res_adj_mm utility commands.
An input file, to be plotted, is always required in res_plot mode.
config
configExample 1: Plot a file, using settings in a file called "local_config.py"
nextdraw file.svg --config local_config.py
Example 2: Plot the same file, using a path to a file in another directory. (Example on Mac; paths look different on other computers.)
nextdraw file.svg -f ~/nextdraw/configs/draft_quality.py
Example 3: Use a configuration file called "estimate.py", which defaults to have preview mode enabled and time reporting. This will not plot the file, but just estimate the time that the file will take to plot.
nextdraw file.svg -f estimate.py
NextDraw Configuration File
Syntax: [-f, --config] file_name
Select a custom configuration file to use. The file_name given in the syntax
above may be a file name in the same directory, or a path to the configuration
file.
An example configuration file can be in the API download at:
examples_config/nextdraw_conf_copy.py
You can duplicate, move, rename, and edit this file as needed, though you should keep the ".py" file extension. You may wish to use different configuration files to have quick settings ready for (for example) draft versus final plotting speeds, different size NextDraw models, different paper size limits, which particular NextDraw unit to plot to, or previewing without plotting. Configuration files do not need to be as complex as the example file; it is perfectly reasonable to use a configuration file that specifies even just a single option value.
Default: Use defaults from the nextdraw_conf.py file installed with the software, rather than from a local configuration file.
progress
progressExample 1: Plot a file with the progress bar enabled:
nextdraw file.svg --progress
Example 2: Plot a file with reordering and displaying progress:
nextdraw file.svg -bG2
Display progress bar while plotting
Syntax: [-b, --progress]
By default progress bars are disabled; nextdraw is a "silent" interface,
providing little if any feedback while a plot is working.
The progress bar may be enabled by using the --progress option (-b).
It is a simple "flag" type argument, and takes no value argument. When enabled,
the progress bar will visually display progress through the plot. It will
also display some additional information such as the estimated print time and
"nextdraw plot complete" when the plot finishes.
A typical display might be as follows (with a line break added for readability):
Plot Progress: 28%|##############2 | 2693/9460
[01:08<02:15, 49.79 mm/s]
The left part (first line) gives the percentage through the plot.
The graph portion represents completed progress by # and partial progress
on the leading glyph (not quite a full #) by numbers 1-9. The fraction after that shows
the progress through the file in terms of total travel in millimeters. Here, we are
at 2693 mm through a plot that has a total of 9460 mm of pen-up + pen-down travel.
The right part (second line, here) gives the elapsed and extrapolated remaining time, formatted as: [(elapsed time) < (remaining time)]. It also shows the average rate of pen movement in millimeters per second (somewhat skewed by the fact that the pen lifts and lowers at 0 mm/s horizontally). In practice, the estimated print time generated before printing tends to be more accurate than the extrapolated time remaining.
When plotting multiple copies, the progress bar shows progress through an individual copy, but is labeled to indicate which copy number is being plotted. A new, simplified progress bar will be displayed during the delay between pages. Delays at the beginning of layers, added by NextDraw Layer Control, are indicated with a second, similar progress bar.
Enabling the progress bar slightly increase the time between initiating the plot and when the machine actually begins to plot, since it quietly runs a plot preview to calculate the plot length and duration. In typical cases, this added time increases the total (computation + plotting) duration of a plot by under 1%. (For very long plots, that can still be a significant time delay.)
The progress bar feature is only available from the NextDraw CLI, when the option is enabled, and in modes that actually plot to the NextDraw ("plot", "layers", "res_plot"). It is not available while running a preview nor while generating a digest without plotting.
To enable progress bars by default, edit nextdraw_conf.py or your
specified config file and change the value of
progress from False to True. (Note that there is not an override to
disable progress bars if enabled in the configuration file.)
Default: False, given by progress in nextdraw_conf.py or your
specified config file.
handling
handlingExample 1: Plot file.svg, using the "Handwriting" Handling mode and short codes:
nextdraw file.svg -z2
Example 2: Plot file.svg, using the "Constant speed" Handling mode
nextdraw file.svg --handling 4
Select Handling mode for motion
Syntax: [-z, --handling] value
The handling option allows you to select one of four general
"Handling modes": Technical drawing, Handwriting, Sketching, or
Constant speed.
These names are descriptive, but you may find that one or a different handing mode
works best for you and your actual usage.
The choice of Handling mode controls the overall scales of precision, speed and acceleration. For example, “100%” speed in Sketching is faster than “100% speed” in Handwriting, and maximum acceleration in Handwriting is higher than Maximum acceleration in Sketching.
Allowed values: Integers from 1 to 4:
1- Technical drawing. [DEFAULT]2- Handwriting3- Sketching4- Constant speed
Technical drawing is the default Handling mode. It uses a moderate top speed, medium-high Maximum acceleration, and high precision. It is a good starting point for many applications, including handwriting-like work in cases where precision is more important than speed.
The Handwriting Handling mode has moderate top speed, very high maximum acceleration, fast pen-up speeds, and relatively low precision. For handwriting-like work where acceleration on tiny strokes and curves is much more important than the top speed that can be achieved, the Handwriting Handling mode can give a significant reduction in total plot time. It is also a great choice for stipple drawings and other artwork or applications that involve very short or curvy movements.
The Sketching Handling mode has a high top speed, moderate Maximum acceleration, fast pen-up speeds, and moderate precision. For artwork or other use consisting of long strokes, where the top speed is more important than acceleration on short strokes, the Sketching Handling mode can give a significant reduction in total plot time.
The Constant speed Handling mode disables acceleration and moves the pen at a constant speed when it is down. It has a relatively low top speed, “instantaneous” acceleration, and high (theoretical) precision. In practice, motion artifacts from taking sharp corners without slowing down can make it less precise than the Technical drawing Handling mode except at low speeds. The Constant speed Handling mode is most useful for specialized applications where moving at a constant speed is a priority. The constant speed motion applied by this mode applies only when the pen is down; Acceleration is used during pen-up travel.
Default: 1 (Technical drawing), set in nextdraw_conf.py or your
specified config file.
speed_pendown
speed_pendownExample 1: Plot file.svg, with maximum pen-down speed of 20% selected:
nextdraw file.svg --speed_pendown 20
Example 2: The same, with short codes:
nextdraw file.svg -s20
Pen-down Movement Speed
Syntax: [-s, --speed_pendown] value
Specify the speed limit for the XY carriage when the pen is down. That is, the maximum speed that the pen may move at while writing or drawing. This value is expressed as a percentage of maximum travel speed.
Pen-down movements use smooth acceleration unless the constant-speed
handling mode option is
selected. Increasing this maximum speed tends to greatly affect behavior at
corners and precision, but has a lesser impact on the average speed and
total plotting time, especially on documents that consist of many small
movements.
Allowed values: Integers from 1 to 100.
Default: 25, set in nextdraw_conf.py or your
specified config file.
speed_penup
speed_penupExample 1: Plot file.svg, with maximum pen-up speed of 50% selected:
nextdraw file.svg --speed_penup 50
Example 2: The same, with short codes:
nextdraw file.svg -S50
Pen-up Movement Speed
Syntax: [-S, --speed_penup] value
Specify the speed limit for the XY carriage when the pen is up. That is, the maximum speed that the pen may move at while moving between paths that will be plotted. This value is expressed as a percentage of maximum travel speed.
Pen-up movements use smooth acceleration whether or not the constant-speed
handling mode option is selected.
Increasing this maximum speed tends to have a minor
effect on plot quality, but can have a significant affect on total plotting
time, especially on documents that have many large pen-up movements.
Allowed values: Integers from 1 to 100.
Default: 75, set in nextdraw_conf.py or your
specified config file.
accel
accelExample 1: Plot file.svg, with maximum pen-down speed of 50%, acceleration 80%:
nextdraw file.svg --speed_pendown 50 --accel 80
Example 2: The same, with short codes:
nextdraw file.svg -s50 -a80
Acceleration Factor
Syntax: [-a, --accel] value
Specify the relative acceleration/deceleration speed. This value is expressed as a percentage of maximum acceleration rate. The acceleration rate does not affect the top speed that can be achieved, but does influence how long it takes to get to different speeds.
Allowed values: Integers from 1 to 100.
Default: 75, set in nextdraw_conf.py or your
specified config file.
pen_pos_down
pen_pos_downExample 1: Plot file.svg, with pen-down height of 20%:
nextdraw file.svg --pen_pos_down 20
Example 2: Cycle the pen down then up, with pen-down and pen-up heights set to 10% and 90% respectively:
nextdraw -mcycle -d10 -u90
Example 3: Lower the pen to 30% height:
nextdraw -mutility -Mlower_pen -d30
Pen-down Position
Syntax: [-d, --pen_pos_down] value
Specify the height of the pen when the pen is lowered (plotting). This value is expressed as a percentage of the vertical travel.
Depending on the operation that you are executing, setting this value may not immediately move the pen height to this position; rather, it sets the height that will be used as the pen-down position value.
Allowed values: Integers from 0 to 100.
Default: 40, set in nextdraw_conf.py or your
specified config file.
pen_pos_up
pen_pos_upExample 1:
Plot file.svg, with pen-up height of 80%:
nextdraw file.svg --pen_pos_up 80
Example 2: Toggle the pen up or down, with pen-down and pen-up heights set to 10% and 90% respectively:
nextdraw -mutility -Mtoggle -d10 -u90
Example 3: Raise the pen to 70% height:
nextdraw -mutility -Mraise_pen -u70
Pen-up Position
Syntax: [-u, --pen_pos_up] value
Specify the height of the pen when the pen is raised (not plotting). This value is expressed as a percentage of the vertical travel.
Depending on the operation that you are executing, setting this value may not immediately move the pen height to this position; rather, it sets the height that will be used as the pen-up position value.
Allowed values: Integers from 0 to 100.
Default: 60, set in nextdraw_conf.py or your
specified config file.
pen_rate_lower
pen_rate_lowerExample 1: Plot file.svg, lowering the pen very slowly to the paper (5% speed):
nextdraw file.svg --pen_rate_lower 5
Example 2: Quickly (90% speed) lower the pen to 10% height:
nextdraw -mutility -Mlower_pen -d10 -r90
Pen Lowering Rate
Syntax: [-r, --pen_rate_lower] value
Specify the rate at which the pen is lowered from the pen-up position to the pen-down position. This value is expressed as a relative percentage.
Allowed values: Integers from 1 to 100.
Default: 50, set in nextdraw_conf.py or your
specified config file.
pen_rate_raise
pen_rate_raiseExample 1: Plot file.svg, raising the pen very quickly from the paper (100% speed):
nextdraw file.svg --pen_rate_raise 100
Example 2: Slowly (10% speed) raise the pen to 60% height:
nextdraw -mutility -Mraise_pen -u60 -R10
Pen Raising Rate
Syntax: [-R, --pen_rate_raise] value
Specify the rate at which the pen is raised from the pen-down position to the pen-up position. This value is expressed as a relative percentage.
Allowed values: Integers from 1 to 100.
Default: 75, set in nextdraw_conf.py or your
specified config file.
no_rotate
no_rotateExample 1: Plot file.svg, with auto-rotation disabled:
nextdraw file.svg --no_rotate
Example 2: The same, with short codes:
nextdraw file.svg -N
Disable auto-rotate
Syntax: [-N, --no_rotate]
Disable auto-rotate; preserve plot orientation.
By default "auto rotate" is enabled: If the SVG file being plotted has a page size that is taller than it is wide, then it will print in landscape mode rather than portrait mode.
Auto-rotate may be disabled by using the --no_rotate option (-N).
It is a simple "flag" type argument, and takes no value argument.
To disable auto-rotate by default, edit
nextdraw_conf.py or your
specified config file and change the value of
auto_rotate from True to False. (Note that
there is not an override to re-enable auto-rotate if it is disabled
in the configuration file.)
report_time
report_timeExample 1: Plot a file and report time elapsed:
nextdraw file.svg --report_time
Example 2: Preview a file, to see how long it will take to run:
nextdraw file.svg -vT
Report time and distance
Syntax: [-T, --report_time]
Report time and distance plotted after the plot finishes.
By default, this option is disabled. Enabling it will print a report of
time and distance travelled after each plot finishes. Using this feature in
combination with Plot Preview (preview) can provide
you with a time estimate of each
plot, without requiring the use of the NextDraw.
Note also that this option is only applicable to the three modes which
parse and plot the SVG document:
plot (default), layers, and res_plot.
When resuming a plot with res_plot mode, please be aware that the distances reported
will reflect the pen-down distance since the beginning of the document, rather than
since the plot resumed. (Distances are calculated this way, using the total pen-down distance
through the document, to ensure that a plot can
be paused and resumed, even if started in res_plot mode.)
Time reporting may be enabled by using the --report_time option (-T). It is
a simple "flag" type argument, and takes no value argument.
To enable this option by default, edit nextdraw_conf.py or your
specified config file and change the value of
report_time from False to True.
utility_cmd
This option allows you to specify exactly which particular "utility" command
will be executed if the mode is set to utility.
This option is ignored if any mode other than utility is active.
Please note that while some of these commands do perform movements, these commands should not be considered "real time" control commands. They are intended as utility commands, for test, setup, and calibration. (If you need real-time movement commands, consider using the Interactive context within the Python API.)
An input SVG file is not required unless an output file is specified. However,
several of the commands (such as res_adj_in, strip_data, etc.) are not useful unless
input or input and output files are specified.
For utility commands such as raise_pen that do not interact with the SVG
document, execution is typically faster without SVG input file.
The following is a list of allowed values of the utility_cmd option.
Each of these commands will be described in detail, after the list.
| Value | Description |
|---|---|
lower_pen |
Lower the pen |
raise_pen |
Raise the pen |
toggle |
Raise the pen if it is lowered, or vice versa |
walk_x |
Walk carriage in X by a distance given in inches |
walk_y |
Walk carriage in Y by a distance given in inches |
walk_mmx |
Walk carriage in X by a distance given in mm |
walk_mmy |
Walk carriage in Y by a distance given in mm |
walk_home |
Walk carriage to origin |
set_home |
Set current carriage position as origin |
enable_xy |
Enable (energize) XY stepper motors |
disable_xy |
Disable (de-energize) XY stepper motors |
res_read |
Read position where a paused plot will resume |
res_adj_in |
Adjust resume position of paused plot in inches |
res_adj_mm |
Adjust resume position of paused plot in mm |
strip_data |
Strip plotter and preview data from file |
list_names |
Read USB "nickname" or port of all attached machines |
read_name |
Read the USB "nickname" of the NextDraw [DEFAULT] |
write_name |
Write the USB "nickname" of the NextDraw |
bootload |
Enter EBB bootloader mode |
Default: 'read_name', set in nextdraw_conf.py
or your specified config file.
lower_pen, raise_pen
utility_cmd: lower pen, raise penExample 1: Lower the pen:
nextdraw -m utility -M lower_pen
Example 2: Raise the pen, very slowly
nextdraw -m utility -M raise_pen --pen_rate_raise 1
Utility commands: Lower or raise the pen holder
Syntax: [-M, --utility_cmd] lower_pen
Syntax: [-M, --utility_cmd] raise_pen
The lower_pen and raise_pen utility commands will, respectively, lower or
raise the pen holder. These are often useful for setup and verification.
Note that lower_pen will only lower the pen if it was in the up state or an
indeterminate state. It will not be lowered if it was already in the pen-down state.
Similarly, raise_pen will only raise the pen if it was in the down state or an
indeterminate state. It will not be raised if it was already in the pen-up state.
toggle
utility_cmd: toggleExample: Toggle pen from up to down, or down to up:
nextdraw -m utility -M toggle
Utility command: Toggle the pen between up and down positions
Syntax: [-M, --utility_cmd] toggle
The toggle utility command will raise the pen if it is already lowered, and
lower the pen if it is already raised.
The initial pen state may not be well defined
after first powering on or resetting the machine, so you may prefer to use the
cycle mode for initial setup and everyday usage.
If you wish to only lower or raise the pen — not toggle to the opposite state — use one of the lower_pen/raise_pen utility commands instead.
walk_x, walk_y
utility_cmd: walk_x, walk_yExample 1: Move the carriage 1 inch in the y direction (one inch forward and away from Home):
nextdraw --mode utility --utility_cmd walk_y
Example 2: Move the carriage 1.5 inches in the +x direction, and then back:
nextdraw -m utility -M walk_x --dist 1.5
nextdraw -m utility -M walk_x --dist -1.5
Example 3: Move the carriage in a square, 10.0 cm on a side, with different speeds for each side of movement, using short codes:
nextdraw -m utility -M walk_x -w 3.937 -s 10
nextdraw -m utility -M walk_y -w 3.937 -s 20
nextdraw -m utility -M walk_x -w -3.937 -s 30
nextdraw -m utility -M walk_y -w -3.937 -s 40
Utility commands: Walk the carriage in the X or Y direction, inch units
Syntax: [-M, --utility_cmd] walk_x
Syntax: [-M, --utility_cmd] walk_y
These two "walk" commands will move the NextDraw carriage by a distance
in inches given by the value of the dist option,
along one axis or the other.
The dist option has a default value of 1.0.
This distance is given in inches, when using the walk_x or
walk_y utility commands.
If you would prefer to use millimeter units, see the
walk_mmx, walk_mmy commands instead.
The walk_x and walk_y movements are relative to the current position (not absolute),
and are NOT checked versus the current carriage position for sane range of
motion. Use caution: They can easily run the NextDraw past its safe range of motion.
Walk movements are "out of band" movements; they can provide a means of offsetting the XY position of the NextDraw carriage before starting a plot. (The position where a plot starts will be the origin for that plot.)
This ability to offset the origin may occasionally provide utility in plot setup, testing, and calibration routines.
After using "walk" movements,
and before plotting, you may wish to return the NextDraw carriage to the Home corner.
Alternately, you can use the walk_home utility command to move the
carriage back to the Global Origin and "reset" the Local Origin to the same position as
the Global Origin.
Please note that these "walk" commands are not meant as a substitute for full motion control. If you require full interactive XY movement, consider using the interactive context within the Python API, which provides full XY movement control as well as software limit checking.
walk_mmx, walk_mmy
utility_cmd: walk_mmx, walk_mmyExample 1: Move the carriage 1 mm in the y direction (one millimeter forward and away from Home):
nextdraw --mode utility --utility_cmd walk_mmy
Example 2: Move the carriage 2.0 inches (50.8 mm) in the +x direction, and then back:
nextdraw -m utility -M walk_mmx --dist 50.8
nextdraw -m utility -M walk_mmx --dist -50.8
Example 3: Move the carriage in a square, 100 mm on a side, with different speeds for each segment of movement, using short codes:
nextdraw -m utility -M walk_mmx -w 100 -s 10
nextdraw -m utility -M walk_mmy -w 100 -s 20
nextdraw -m utility -M walk_mmx -w -100 -s 30
nextdraw -m utility -M walk_mmy -w -100 -s 40
Utility commands: Walk the carriage in the X or Y direction, mm units
Syntax: [-M, --utility_cmd] walk_mmx
Syntax: [-M, --utility_cmd] walk_mmy
These two "walk" commands will move the NextDraw carriage by a distance
in millimeters given by the value of the dist option,
along one axis or the other.
The dist option has a default value of 1.0.
This distance is given in millimeters, when using the walk_mmx or
walk_mmy utility commands.
If you would prefer to use inch units,
see the walk_x, walk_y commands instead.
The walk_mmx and walk_mmy movements are relative to the current position (not absolute),
and are NOT checked versus the current carriage position for sane range of
motion. Use caution: They can easily run the NextDraw past its safe range of motion.
Walk movements are "out of band" movements; they can provide a means of offsetting the XY position of the NextDraw carriage before starting a plot. (The position where a plot starts will be the origin for that plot.)
This ability to offset the origin may occasionally provide utility in plot setup, testing, and calibration routines.
After using "walk" movements,
and before plotting, you may wish to return the NextDraw carriage to the Home corner.
Alternately, you can use the walk_home utility command to move the
carriage back to the Global Origin and "reset" the Local Origin to the same position as
the Global Origin.
Please note that these "walk" commands are not meant as a substitute for full motion control. If you require full interactive XY movement, consider using the interactive context within the Python API, which provides full XY movement control as well as software limit checking.
walk_home
utility_cmd: walk_homeExample 1: Move the carriage back to the position where it was enabled, for example after a plot was stopped.
nextdraw --mode utility --utility_cmd walk_home
Example 2: Move the carriage 2.0 inches (50.8 mm) in the +x direction, and then back:
nextdraw -m utility -M walk_mmx --dist 50.8
nextdraw -m utility -M walk_home
Utility command: Walk the carriage back to its Orign
Syntax: [-M, --utility_cmd] walk_home
The walk_home utility command is a special "walk" type command
that moves the carriage to the Global Origin.
The Global Origin is the position where the motors are first enabled
(when using manual homing) or in the physical
Home position of the machine (when using automatic homing). The Global Origin
can then be set to a different location by using the set_home
utility command.
Thus, the walk_home command normally returns the carriage to the Home position.
But, if the motors were initially enabled
in some different position (and automatic homing is not enabled), this
command will instead return the machine to that other position. And, if
set_home was used to locate the Global Origin elsewhere, then
walk_home will return the carriage to that location.
This command can be used to reset the NextDraw carriage position — moving
it back to Home — after one or more of the other "walk" commands.
Using walk_home clears any offsets applied with the "walk" commands, and
resets the temporary "Local Origin" that the "walk" commands can create back
to be the same as the Global Origin.
A common use for walk_home is to return the NextDraw to the Home position,
for example after pausing a plot that will not be resumed.
Note that changing the motor resolution
(for example, by changing the handling mode) will
generally count as "re-enabling" the motors
with the new resolution, and may alter the position that walk_home will return to.
set_home
utility_cmd: set_homeExample : Use walk commands to offset the NextDraw by (20, 0) mm from the Home position, and then call set_home to mark that position as the Global Origin. Test it by moving further off by (20, 10), and then return to (20, 0) by using walk_home
nextdraw --mode utility --utility_cmd walk_mmx --dist 20
nextdraw --mode utility --utility_cmd set_home
nextdraw -m utility -M walk_mmx -w 20
nextdraw -m utility -M walk_mmy -w 10
nextdraw -m utility -M walk_home
Utility command: Set current position as Global Origin
Syntax: [-M, --utility_cmd] set_home
The set_home utility command sets the current carriage position as the
Global Origin,
which is to say, it sets the current position as the position
that the walk_home utility command returns to.
In detail, set_home performs the following actions:
- Wait for any queued motion commands to complete
- Mark the machine as currently "homed"
- Clear any local offsets applied by the "walk" commands
- Set the current XY position to (0, 0)
Because the home position is reset whenever the motors are re-enabled,
using set_home has no effect in practice when there is no power to the pair
of stepper motors that controls the XY position of the NextDraw carriage.
enable_xy, disable_xy
utility_cmd: enable_xy, disable_xyExample 1: Enable the XY stepper motors:
nextdraw --mode utility --utility_cmd enable_xy
Example 2: Disable the XY stepper motors:
nextdraw -m utility -M disable_xy
Utility commands: Enable or Disable the XY motors
Syntax: [-M, --utility_cmd] enable_xy
Syntax: [-M, --utility_cmd] disable_xy
These two commands turn on or turn off, respectively, power to the pair of stepper motors that controls the XY position of the NextDraw carriage.
Stepper motor power is off by default at power up. It is often useful to turn off power to the XY motors so that the carriage can be manually moved to the home corner, prior to plotting.
res_read
utility_cmd: res_readExample: Strip NextDraw data from file.svg and save the result as output.svg:
nextdraw file.svg -m utility -M res_read -o output.svg
Typical response, with a file paused at 200 mm of pen-down travel:
Plot was paused after 200.000 mm (7.874 inches) of pen-down travel.
Typical responses, for a file that finished plotting normally:
No in-progress plot data found in file.
To set up the plot to be resumed at a given point, add an offset.
Typical response, with a file that has had its resume position adjusted:
Plot was originally paused after 200.000 mm (7.874 inches) of
pen-down travel. The resume position was then adjusted to 225.400 mm
(8.874 inches).
Utility command: Read position where a paused plot will resume
Syntax: [-M, --utility_cmd] res_read
When a plot is paused, the progress through the file is saved in the SVG document so that
the plot may be resumed later with res_plot mode. The res_read utility
command reads the SVG and reports that progress as human-readable text.
Plot progress is measured as the total path length of pen-down movement
from the beginning of the plot to where it was paused. One may adjust that
distance, so it is more proper to say that it measures the pen-down distance from the
beginning of the plot to the point where the NextDraw would resume plotting with
res_plot mode.
The "beginning of the plot" refers to the first vertex of the first plottable object in the SVG document. (Exactly what that object is depends on which optimizations are applied and, for example, whether the plot was started in Layers mode.)
The "beginning of the plot" still refers to the first plottable object, even
when a plot is resumed with res_plot mode; it is
not the position from which the plot was resumed. For example, if a plot were paused after
plotting paths with a total arc length of 250 mm, and then resumed and paused again
after drawing another 100 mm, res_plot would report a value of 350 mm.
The resume position can be adjusted with the res_adj_in and
res_adj_mm commands. See the
res_plot mode description for further discussion
of pause-and-resume methods when using this API.
res_adj_in, res_adj_mm
utility_cmd: res_adj_in, res_adj_mmExample 1: Adjust resume position from file.svg, such that when resumed it would start 20 mm before its pause position.
nextdraw file.svg -m utility -M res_adj_mm --dist -20 -o file.svg
Typical response, with a file paused at 200 mm of pen-down travel:
Plot was paused after 200.000 mm of pen-down travel.
After adding a new offset of -20.000 mm, the resume position
is now set at 180.000 mm.
Example 2: Configure a document to begin printing (when used with res_plot mode) after 12.5 inches of pen-down distance.
nextdraw file.svg -m utility -M res_adj_in --dist 12.5 -o file.svg
Typical response, with a file that was not initially paused:
This document was configured to start plotting at the beginning
of the file. After adding a new offset of 12.500 inches, the
resume position is now set at 12.500 inches.
Utility commands: Adjust resume position of paused plot
Syntax: [-M, --utility_cmd] res_adj_in
Syntax: [-M, --utility_cmd] res_adj_mm
These two commands adjust the position where a paused plot will resume,
by a distance given by the value of the dist option and
units selected by choosing either res_adj_in or res_adj_mm.
See the res_read command description for how to read the existing
resume position and for an extended discussion of what that position means.
The dist option has a default value of 1.0 and can be positive or negative.
Its value, in units of inches when using res_adj_in, and in millimeters
when using res_adj_mm, is added to the the current resume position
to produce the new position.
If the new resume position is less than or equal
to zero, it will reset to zero (the beginning of the plot), where
res_plot mode cannot "resume" the plot. The
resume position can also be set to a distance longer than the total pen-down
length of the plot. In that case, res_plot mode can be run, but nothing will
print (since the resume point is after the end of the plot).
If an SVG document does not have any in-progress plot saved, it
is possible to use res_adj_in or res_adj_mm to add an offset
from zero, and then start a plot at that position using res_plot.
This provides a means of starting a plot partway through, even if
it did not begin as a paused plot.
strip_data
utility_cmd: strip_dataExample: Strip NextDraw data from file.svg and save the result as output.svg:
nextdraw file.svg -m utility -M strip_data -o output.svg
Utility command: Strip plotter data from SVG file
Syntax: [-M, --utility_cmd] strip_data
When you save an output file with output_file, the NextDraw software
stores certain configuration data within that SVG document.
This data includes the setup data necessary for resuming a file that was paused
or otherwise stopped while printing, as well as any rendered previews.
While this data does not typically cause any issues, the strip_data utility command
can strip that data from the file, should that need arise.
In detail, strip_data removes:
- Stored configuration data within the SVG file
- Any ability to resume a plot that was paused
- Any “resume” warning about a plot containing a paused plot
- Rendered preview layers
In practice this command no effect unless an output file is specified.
list_names
utility_cmd: list_namesExample: List connected NextDraw units:
nextdraw -m utility -M list_names
Typical response (with two connected NextDraw units, on Mac):
East
/dev/cu.usbmodem1441
Typical response (with two connected NextDraw units, on Windows):
East
COM4
Utility command: List connected NextDraw units
Syntax: [-M, --utility_cmd] list_names
List connected NextDraw units, by USB "nickname" (if assigned) or by their USB port enumeration. NextDraw and AxiDraw machines may have a USB "nickname" assigned to them.
This list of connected units does not indicate whether or not an NextDraw is presently busy with another task; it simply lists each unit that is detected by your computer's USB interface.
See documentation for read_name and write_name below for more
about NextDraw naming.
read_name
utility_cmd: read_nameExample: Read the USB Nickname from a single connected NextDraw:
nextdraw --mode utility --utility_cmd read_name
Typical responses:
NextDraw nickname: NextDraw 16
or
This NextDraw does not have a nickname assigned.
Utility command: Read NextDraw USB Nickname
Syntax: [-M, --utility_cmd] read_name
The read_name option is for reading an assigned USB
"nickname." A nickname may be assigned to a given NextDraw or AxiDraw machine.
Nicknames are not required, but may be
helpful when operating more than one NextDraw: You can specify the given
machine by name. (See the --port option for additional information.)
When reading the name, it may be helpful to disconnect all NextDraw
units other than that one, so that you can be sure of which NextDraw you
are communicating with. Alternately, you can use an identifying action
(say, toggling the pen) to identify which unit you are communicating
with, or specify a --port option.
write_name
utility_cmd: write_nameExample 1: Write a USB Nickname to a single connected NextDraw:
nextdraw -m utility -M "write_nameNextDraw 17"
Typical response:
Nickname written. Rebooting EBB.
Example 2: Clear the USB Nickname from the machine nicknamed "NextDraw 17":
nextdraw -m utility --port "NextDraw 17" -M "write_name"
Utility command: Write NextDraw USB Nickname
Syntax: [-M, --utility_cmd] write_name[NICKNAME]
The write_name command is for assigning a USB "nickname". A nickname
may be assigned to a given NextDraw or AxiDraw machine. Nicknames are not required, but may be
helpful when operating more than one NextDraw: You can specify the given
machine by name. (See the --port option for additional information.)
When writing the name, it may be helpful to disconnect all NextDraw
units other than that one, so that you can be sure of which NextDraw you
are communicating with. Alternately, you can use an identifying action
(say, toggling the pen) to identify which unit you are communicating
with, or specify a --port option.
When using write_name, the name itself is specified by concatenating the
name with the write_name option. For example as write_nameNorth to
assign the nickname "North". The name may be up to 16 characters long.
Using a nickname of at least 3 characters is recommended. Writing an
empty string (with nothing following write_name) will clear the
nickname. In cases where the name has a space, use quotation marks to
enclose the combined command, as in "write_nameNextDraw 17".
Assigned Nicknames are semi-permanent; they will persist when power is cycled, but can be overwritten by this command, (or other utilities that assign a nickname), and will be erased (reset to default) if you should run a firmware update at some point in the future.
Since the nickname itself is stored in a certain flash memory cell that can only be written a limited number of times, avoid applications that involve automated, repeated changes to the nickname tag.
bootload
utility_cmd: bootloadExample: Put the NextDraw into bootloader mode:
nextdraw --mode utility --utility_cmd bootload
(Note that you will need to either update the firmware OR disconnect both power and USB after executing this command.)
Utility command: Enter EBB Bootloader Mode
Syntax: [-M, --utility_cmd] bootload
This command will put the NextDraw's EBB control board into bootloader mode. This is a special mode that is sometimes used as part of the process of updating the EBB firmware. This command is not used in any part of normal NextDraw operation.
Bootloader mode may be identified by a particular rhythmic blinking of LEDs on the control board. If you should accidentally enter bootloader mode, disconnect the NextDraw from both USB and power and then connect them again.
dist
distExample 1: Move the carriage 2.5 inches in the +x direction, and then back.
nextdraw --mode utility --utility_cmd walk_x --dist 2.5
nextdraw -m utility -M walk_x -w -2.5
Example 2: Adjust resume position from file.svg, such that when resumed it would start 20 mm before its existing pause position.
nextdraw file.svg -m utility -M res_adj_mm --dist -20 -o file.svg
Distance for Walk and Adjust Resume Position utility commands
Syntax: [-w, --dist] value
The dist option provides the amount of distance for
utility mode commands, when the command specified by
utility_cmd requires a distance input.
The value of dist is a floating point number that may be positive or
negative. Its default value is 1.0.
The units of the distance given by dist are selected by choosing
a specific utility command. The distance is in millimeters
for utility commands walk_mmx or walk_mmy
and for the res_adj_mm command to adjust resume position.
The distance is in inches for utility commands
walk_x or walk_y
and for the res_adj_in command to adjust resume position.
Values of dist should be chosen with care, since no limit checking is performed.
This is especially true with the "walk" commands, which are relative to the
current position (not absolute), and are
NOT checked for safe range of motion. These are fully manual commands, and
can easily run the NextDraw past its safe range of motion.
Allowed values: Floating point numbers (not limit checked).
Default: 1.0, set in nextdraw_conf.py or your specified config file.
layer
layerExample 1: Plot only layers with layer name beginning with "3":
nextdraw file.svg --mode layers --layer 3
Example 2: The same, with short codes:
nextdraw file.svg -m layers -l3
Select layer(s) to plot when in layers mode
Syntax: [-l, --layer] value
Specify a number which indicates which layer (or layers) will be plotted
when plotting in layers mode.
Normally, when plot mode is selected, we plot paths from all layers. You can also choose to plot a single layer or group of layers, for example to plot only a single color of ink.
Plotting in layers mode, with a given layer specified by this option
will plot only layers whose names begin with the selected number.
While only a single integer value may be given for layer,
that value may match with multiple layer names, so that any number of
layers may be selected for plotting.
For example, suppose that your file has layers with the following names:
- "guide lines"
- "5-red"
- "2 black"
- "55"
- "5 Outlines"
Then, if a layer option of 5 is given in layers mode,
the two layers named
"5-red" and "5 Outlines" will be plotted, while the layers named
"guide lines", "55", and "2 black" will be skipped.
Allowed values: Integers from 1 to 1000.
Default: 1, given by default_Layer in nextdraw_conf.py or your
specified config file.
copies
copiesExample 1: Plot a file two times, using default options:
nextdraw file.svg --copies 2
Example 2: Plot a file continuously (until paused by button or Control+C):
nextdraw file.svg -c0
Example 3: Plot a file 25 times, with a 5 s delay between each plot:
nextdraw file.svg --copies 25 --page_delay 5
Number of copies to plot
Syntax: [-c, --copies] value
If copies has a value other than 0, then a plot that is started in plot or
layers mode will be plotted that number of times. This option has no
effect in modes other than plot or layers.
An optional delay may be chosen between subsequent plots (e.g., for changing
paper) with the page_delay option.
A value of 0 copies is a special value that will begin plotting a continuous sequence of copies, without a scheduled end. The sequence will continue until the Control+C or the physical pause button is pressed.
A set of plots in progress can be paused at any time by pressing Control+C or the physical pause button on the NextDraw. If a plot is active when paused, it will stop at that location in the usual way (saving progress in the output file, if an output file is specified). If paused while at home waiting between copies, then it simply exits without plotting any additional copies and without an error message.
Allowed values: Integers from 0 to 9999.
Default: 1, given by copies in nextdraw_conf.py or your
specified config file.
page_delay
page_delayExample 1: Plot a file 2 times, with a 5 s delay between plots
nextdraw file.svg --copies 2 --page_delay 5
Example 2: Plot continuously, with a 30 s delay between each plot:
nextdraw file.svg -c0 -D30
Delay between copies
Syntax: [-D, --page_delay] value
When plotting multiple copies, specify the delay in seconds between subsequent plots.
This value is used to specify the time interval that the NextDraw dwells at
the Home position between subsequent layer or document plots, when plotting
multiple copies. See the description of --copies for more information.
Allowed values: Non-negative numbers.
Default: 15; set in nextdraw_conf.py or your
specified config file.
preview
previewExample 1: Do not plot a file, but report how long it will take to plot.
nextdraw file.svg -v --report_time
Example 2: Preview a file, generating a rendered preview of all motion, making use of the output file (-o) option to save the output file as "outputfile.svg"
nextdraw file.svg -v -o outputfile.svg
Plot preview
Syntax: [-v, --preview]
Plot Preview is an offline simulation setting that, if enabled, disables communication to the USB port and the NextDraw does not move. This can be useful for one or more of the following reasons:
- To estimate (in combination with
report_time) the duration of a plot. - To render (if an output file is given) a graphical representation of the plot, to verify that the file will plot correctly.
- To perform a "preflight check" for any errors that might be encountered while plotting the file.
Since it is an offline simulation, it can be used even without an NextDraw present.
Note that the Plot Preview can be used in combination with other modes. If enabled, no serial communication will be attempted, so certain operations (e.g., raise pen) will neither function nor produce an error.
If Plot Preview is enabled, then it will also, by default, produce graphical output if
an output file is generated. Preview rendering can be disabled with the
no_render option.
Rendered previews can be removed
from an SVG file with the strip_data utility command.
Preview mode may be enabled by using the --preview (-v) option. It is a
simple "flag" type argument, and takes no additional values.
Default: False, set in nextdraw_conf.py or your specified config file.
no_render
renderingExample 1: Run a Plot Preview for a file, without generating a rendered preview of pen motion, but saving the output file anyway. Reporting the estimated duration of the plot, and make use of making use of the -v, -T, -g, and -o short codes:
nextdraw file.svg -vTgo outputfile.svg
Example 2: The same, but using the un-abbreviated --no_render flag:
nextdraw file.svg -vTo outputfile.svg --no_render
Disable preview rendering
Syntax: [-g, --no_render]
When plotting with Plot Preview --preview (-v) enabled and with an
output file (--output_file or -o) specified, the default behavior is
that a rendered preview of the plot, showing pen-up and pen-down motion,
will be added to the output SVG file.
Preview rendering can be disabled, so as to not add a rendered preview to the
file, by using the --no_render option (-g). It is a
simple "flag" type argument, and takes no value argument
This option is only applicable to the three modes which parse and plot the SVG document: plot (default), layers, and res_plot. Further, it only has an effect when Plot Preview is enabled.
When a preview is rendered, that preview is added to the output SVG document, in a special "documentation" layer that will not be plotted. (For more information about documentation layers, please see the NextDraw Layer Control documentation.)
The preview layer has sub-layers for showing the pen-up and/or pen-down movement of the carriage, depending which are generated.
To disable preview rendering by default, edit nextdraw_conf.py or your
specified config file and change the value
of rendering from True to False.
reordering
reorderingExample 1: Plot an SVG file (file.svg), reordering for speed including allowing path reversal prior to plotting.
nextdraw file.svg -G2
Example 2: Preview how an SVG file (file.svg) will plot with basic optimization, reordering elements for speed but preserving their directions. SVG objects in the output SVG file will be preserved in their original order.
nextdraw file.svg -vT -G1 -o out.svg
Specify level of plot optimization
Syntax: [-G, --reordering] value
When so selected with the reordering option, a plot optimization tool is used to re-order
elements in the input SVG prior to plotting or rendering a preview. By changing the order
and (optionally) direction of paths, the plot duration can be lowered by reducing the amount of
pen-up travel required during the plot.
The reordering option is only applicable in the modes that parse and plot the SVG document:
plot (default), layers, and res_plot.
Normal order of plotting
Normally and by default, each path within a SVG document is plotted (with one exception) in the same order and in the same direction as it appears in the document. This order is generally the order in which the objects were created. In a graphical vector editor like Inkscape, newer objects are drawn on top of older ones; a "lower" object is one that appears earlier in the document.
The exception is that if one path ends very close to where another begins (and if those
paths are not separated by layers), then those two paths are normally joined together,
skipping an unnecessary pen lift. The maximum gap that can be joined is given by the
min_gap parameter in the nextdraw_conf.py configuration file.
The default option, which generally respects the original document order, is often preferable, for example in handwriting-like applications, where you may wish the writing to be in the same order that a person would write the words, e.g. right-to-left, top-to-bottom on the page.
How reordering works
When you plot an SVG document, the following operations occur:
- A temporary copy of the SVG document is made.
- Graphical elements like circles and rectangles are rendered into paths.
- The document is separated by layers.
- Within each layer:
- All groups, sub-layers, and compound paths are broken apart.
- Paths are joined together if one starts where another ends.
- The paths are re-ordered for speed.
- The document is plotted (or the preview is rendered).
- The document is reverted to the temporary copy.
- If rendering a preview, the preview paths are added to the document.
Path sorting uses a "greedy" algorithm, a suboptimal but relatively fast approach. Depending on the nature of the SVG document, it can reduce the pen-up travel distance by 50-90% and reduce the plotting time by 30-50%. Potential time savings should be weighed against the execution time of the sort, which may be considerable for documents with a great number of separate objects. In most cases reordering adds only a few seconds before plotting starts and results in a significant overall time savings.
If path reversal is allowed, then:
- The stage of joining two paths with coincident ends will check to see if paths can be joined if one or both are reversed.
- Sorting the paths for speed will consider reversing each path.
If path reversal is not allowed, then every path will be plotted in the same direction as it occurs in the document, even if that results in a slower plot.
You may find it helpful to run plots
with preview, default rendering (i.e., not no_render),
and/or report_time enabled.
With those tools, you can visualize the effect that optimization has with
different values of reordering and estimate the plot duration on documents
that have and have not been sorted.
Re-ordering is by layer
The optimization tool is layer-aware: All objects will be left on their original layers. That makes it safe to use on multicolor plots where colors are separated by layers.
An SVG document without layers can still be optimized. The document root, the set of elements that are not in layers, is re-ordered as though it is a single layer.
If the SVG contains elements in document root that are separated by layers, each set of elements that is not separated by layers is treated as a virtual layer for the purposes of reordering.
Changes to the document are not saved
The changes to the order of elements in the SVG document are ephemeral and only made to the temporary copy. If you save an output SVG, the objects in that output SVG will retain their original order.
For example, even if your SVG document has deeply nested groups, you can plot it with
the reordering of 2 (which will ignore grouping within layers), but if you save the
output SVG, it will retain your original grouping.
Values of the reordering option
Allowed values: Integers from 0 to 4:
- 0: Least; Only connect adjoining paths. [DEFAULT]
- 1: Basic; Also reorder paths for speed
- 2: Full; Also allow path reversal
- 3: [Reserved for future use; currently same as 2.]
- 4: None; Strictly preserve file order
The reordering values of 0 and 4 are identical except that the "strict" value of 4 also disables
path joining. Path joining may be disabled separately via the min_gap parameter value.
Default: 0 (Plot in original order, connecting adjoining paths to reduce unnecessary pen lifts), set in nextdraw_conf.py or your specified config file.
random_start
random_startExample 1: Plot a file, randomizing the start position of closed shapes within that file:
nextdraw file.svg --random_start
Example 2: The same, using short codes:
nextdraw file.svg -Y
Randomize start positions of closed paths
Syntax: [-Y, --random_start]
Randomize start locations of closed paths.
By default, this option is disabled, and the NextDraw will draw closed paths
in the direction that they are given in the file (or possibly, the reverse of that,
depending on the reordering option).
A pen may form a visible mark at the location where it is lowered or raised. In artwork where the same closed shape is repeated many times, that can cause a seam-like visual artifact if many of those marks line up at matching points on the repeated shapes.
With the random_start option, the start position of closed paths —
paths where the start points and end points are coincident — will be randomized,
which can help to hide that specific type of visual artifact.
This feature may be enabled by using the --random_start option (-Y). It is a
simple "flag" type argument, and takes no value argument
To enable this option by default, edit nextdraw_conf.py or your
specified config file and change the value
of random_start from False to True.
hiding
hidingExample 1: Plot a file, using hidden-line removal:
nextdraw file.svg --hiding
Example 2: The same, using short codes:
nextdraw file.svg -H
Enable hidden-line removal
Syntax: [-H, --hiding]
By default, this option is disabled, and the NextDraw will draw all paths (or objects that can be directly represented as paths) in the SVG document. All fill and stroke (outline) properties of individual objects are ignored. Phrased differently, All paths are normally plotted as though there is a stroke along the path and no fill.
When the hiding option is enabled, the NextDraw software will instead plot paths (or not)
based (1) on their fill and stroke properties and (2) whether or not
they are occluded behind other objects. An object that does not have a stroke property (e.g.,
no outline in Inkscape) will not plot, nor will one hidden behind a solid fill.
Typically, when working with documents that include filled regions, this means that the
NextDraw output will visually resemble the original SVG artwork more closely. In cases of
ambiguity, consider running Plot Preview (preview) with rendering enabled in
order to understand how the document is processed.
There are two important drawbacks to bear in mind. First, the hiding option requires
additional processing time before plotting, especially in instances with large numbers of
objects to process. Second, hidden-line removal does not
preserve the orientation of individual SVG strokes.
We generally recommend using the reordering option, with "full" reordering,
to orient the output paths for efficient plotting.
In cases where the processing time becomes large, or when processing repeatedly might be needed
(as in, when a document might be paused and resumed during the plotting process),
it may be convenient to instead process the
document once, separately, using the digest option.
This feature may be enabled by using the --hiding option (-H). It is a
simple "flag" type argument, and takes no value argument
To enable this option by default, edit nextdraw_conf.py or your
specified config file and change the value
of hiding from False to True.
model
modelExample 1: Plot a file, while setting size limits for Bantam Tools NextDraw 2234:
nextdraw file.svg --model 10
Example 2: Plot the same file, restricting the motion area to that of the AxiDraw V3 XLX:
nextdraw file.svg -L3
Select plotter model
Syntax: [-L, --model] value
Select which specific plotter model you are using. This is used to set the limits of travel and configure certain other model-specific parameters. Travel limits are set by dead reckoning, under the assumption that a given plot was started in the Home Corner, and that no loss of position control has occurred. Paths in the document will be clipped to the edges of the SVG document or of physical travel, whichever is smaller for each axis.
Travel limits are not checked when using "walk" commands.
Allowed values: Integers from 1 to 10:
1- AxiDraw V2, V3, or SE/A42- AxiDraw V3/A3 or SE/A33- AxiDraw V3 XLX4- AxiDraw MiniKit5- AxiDraw SE/A16- AxiDraw SE/A27- AxiDraw V3/B68- Bantam Tools NextDraw™ 8511 (Default)9- Bantam Tools NextDraw™ 111710- Bantam Tools NextDraw™ 2234
Default: 8 (Bantam Tools NextDraw™ 8511), set in nextdraw_conf.py or your
specified config file.
The model-specific parameters that are set by the model selection can be
overridden in your configuration file (nextdraw_conf.py or a custom configuration file),
in the overrides section.
penlift
penliftExample 1: Plot a file, using default pen-lift configuration.
nextdraw file.svg --penlift 1
Example 2: Plot a file, using narrow-band brushless pen-lift servo motor.
nextdraw file.svg -q3
Pen lift servo configuration
Syntax: [-q, --penlift] value
Select the hardware configuration for the pen-lift servo mechanism. This option is generally not needed unless you are using an AxiDraw machine that has been upgraded with a brushless pen-lift servo motor.
The default value, 1, specifies to use the standard configuration
for the plotter model that is selected.
On an AxiDraw, that is a standard hobby micro servo (including coreless versions).
On a Bantam Tools NextDraw, the standard pen-lift mechanism is a narrow-band
brushless servo motor.
A value of 3 selects the use of a narrow-band brushless pen-lift servo motor, even if
the default for the model is the standard motor.
Select this option for an AxiDraw with a brushless upgrade.
Allowed values: Integers from 1 to 3:
1- Default for model.2- [Reserved for future use; currently same as 1.]3- Brushless upgrade
Default: 1 (Default for NextDraw model), set in nextdraw_conf.py or your
specified config file.
no_homing
no_homingExample 1: Plot a file, disabling automatic homing:
nextdraw file.svg --no_homing
Example 2: The same, using short codes:
nextdraw file.svg -n
Disable automatic homing
Syntax: [-n, --no_homing]
Automatic homing is enabled by default when you have selected a Bantam Tools NextDraw™
with the model option.
Automatic homing can be disabled, leaving the machine to use manual homing
only, by using the --no_homing option (-n). It is a
simple "flag" type argument, and takes no value argument.
When automatic homing is disabled (or when using AxiDraw models, which do not support automatic homing), make sure to move the carriage fully to the Home corner before beginning a plot or interactive session. An extended discussion about homing is available in section "3.2 Automatic and Manual Homing" of the Bantam Tools NextDraw User Guide.
The no_homing option has no effect when a model that does not support
automatic homing is selected.
To disable homing by default, edit nextdraw_conf.py or your
specified config file and change the value of
homing from True to False.
port
portExample 1: Plot a file to the USB port enumerated as /dev/cu.usbmodem1441:
nextdraw file.svg -p /dev/cu.usbmodem1441
Example 2: Plot a file to an NextDraw with USB Nickname "GlueDispenser":
nextdraw file.svg -pGlueDispenser
Example 3: Plot a file to an NextDraw with USB Nickname "UV LED Array":
nextdraw file.svg --port "UV LED Array"
Specify a USB port or named NextDraw to use
Syntax: [-p, --port] value
By default, the NextDraw software works with the first available NextDraw
located on USB. Alternately, you can use the port option to specify a
particular machine. You can specify the machine using the USB port
enumeration (e.g., COM6 on Windows or /dev/cu.usbmodem1441 on a Mac) or by
using an assigned USB nickname.
If any port is specified, then the software will attempt to open the
connection to that (and only that) NextDraw or USB port. It will return an
error if the port or NextDraw cannot be found. This behavior may be
overridden by use of the port_config option.
USB port enumerations are typically not permanent; they may change with events as simple as unplugging a device and plugging it back in.
For a more permanent designation, you can assign an "NextDraw USB Nickname"
to a given machine as well. This USB nickname may be read and written using
the utility commands. (See utility_cmd for additional information.)
Be aware that if multiple NextDraw units are connected to one computer, it may not be trivial to identify which physical machine is currently identified as which USB device. You may wish to try an identifying action, for example raising the pen, to indicate which machine is which.
Allowed values of the port option are strings, which specify either the USB port or NextDraw USB nickname to use.
Default: None, set in nextdraw_conf.py or your
specified config file.
port_config
port_configExample 1: Plot a file only to an NextDraw with USB Nickname "UV LED Array"; Return an error if that unit is not found, explicitly using the default value (0) of port_config:
nextdraw file.svg -p "UV LED Array" --port_config 0
Example 2: Plot a file to the first available NextDraw found on USB:
nextdraw file.svg --port "NextDraw 19" -P1
Example 3: Plot the same file simultaneously to all attached NextDraw units:
nextdraw file.svg -P3
Override how the USB ports are located
Syntax: [-P, --port_config] value
By default, the software handles assignments of USB ports as follows:
If no
portvalue is specified, the first NextDraw located via USB will be used.If a
portvalue is specified, then the software will attempt to communicate only with that specified NextDraw.
The port_config option can override this behavior. Allowed values of the
option are integers 0, 1, and 3:
0- Do not override; use standard "port" option behavior.1- Address only the first NextDraw located via USB3- Address all NextDraw units located via USB
If port_config is 0, then the software will follow the default
behavior described above.
If port_config is 1, then the software will communicate only with
the first NextDraw located, even if even if a --port option is specified.
If port_config is 3, the software will simultaneously communicate with
all NextDraw units located via USB. While most features (including plotting)
are supported and work well in this fashion, note that are some important differences.
Please see "Working with multiple
NextDraw machines" below for an extended discussion.
Default: 0, set in nextdraw_conf.py or your
specified config file.
output_file
output_fileExample 1: Plot a file named input.svg, and save an output file as output.svg:
nextdraw input.svg -o output.svg
Example 2: Preview a file, generating and saving a rendered preview of motion, and calculating the estimated duration of the plot:
nextdraw file.svg -Tv -o outputfile.svg
Specify output SVG file name
Syntax: [-o, --output_file] file_name
Normally, this program accepts an SVG file as input, and does not produce an output file. However, if an output file name is specified, then it will produce and save an output SVG file. The output file contains the same SVG drawing that it accepted as input, but may also have plot progress saved in the file, or a rendered preview.
See the documentation above, under res_plot, for
more about how the plot progress data is saved in the output file, and how
that can be used for the resume modes.
See the documentation above under both preview and
no_render
for more about how rendered previews are generated.
See the digest feature below for an option to save an optimized
"Plob" plot digest, rather than the full SVG.
While certain utility modes do not generally require that an input file is specified, an input file is required in all cases when an output file is specified.
Allowed values of the option are strings, which specify the output file name, or a relative or absolute path ending in a file name.
Default: None
digest
digestExample 1: Plot a file named input.svg, and save the "Plob" plot digest instead of the full SVG:
nextdraw input.svg --digest 1 -o output_plob.svg
Example 2: Generate a "Plob" plot digest from the file named input.svg, and save it without plotting the document or rendering a preview:
nextdraw input.svg -O2 -o output_plob.svg
Plot digest output option
Syntax: [-O, --digest]
When a digest value greater than 0 is chosen, the output_file will not be
the (lightly modified) input SVG, but instead a "plot digest object", or Plob.
A Plob is a restricted-format subset of SVG that the NextDraw software "digests"
the file into before plotting.
In detail, the Plob is a new file generated from the input SVG after:
- Removing hidden and non-printable layers and objects
- Removing ignored layers, if working in
layersmode. - Reducing all plottable shapes and paths to vertex lists
- Applying, then removing any transformations
- Removing all style information
- Applying the auto-rotate function (if enabled)
- Cropping all paths at the plot edges
- Joining together sufficiently close path ends (unless disabled)
- Randomizing the start point of closed paths (if enabled)
- Reordering paths in the document for speed (if enabled)
- Flattening the document structure
- Adding metadata including the hardware model
Generating the Plob is destructive; any SVG shapes such as rectangles or original paths that were present in the original SVG document will not be present in the Plob output. Keep a copy of your original SVG document.
A Plob file may be used as the input to the NextDraw software, just like any other SVG input. Plotting a Plob prepared for the same NextDraw model allows the NextDraw software to skip all of the steps above and immediately begin plotting the document. Note however, that once generated, the Plob file cannot be modified at all, or it will no longer be recognized as a valid Plob file. (Two exceptions: Pause/resume data and plot preview updates are permitted modifications.)
If a plot underway is
paused while the digest option is enabled, the output Plob will include plot progress data for
resuming the plot, just as a regular SVG would. Partial plots -- those paused while plotting
or that resume plotting in the middle of the document -- still contain the entire Plob
including the parts that are not printed in those situations.
The digest option may be helpful in a variety of situations, including but not limited to:
- Processing a document once into a Plob that can be plotted many times
- Using different computers for document preparation versus plotting
- Improving the speed of operations that involve pause and resume cycles
- Separating a document with named layers into separate files
If a digest value of 1 is chosen and an output file is saved, that output file will be
in the Plob format (instead of full SVG), but no other changes occur.
Plots and plot previews will proceed normally.
A digest value of 2 overrides most software functions, to only generate
the Plob and perform no other function.
(Internally, it enables preview but disables running previews and time estimates.)
Using this option minimizes the total time for Plob generation, as there is no need to
wait for a plot or preview to finish.
Allowed values: Integers from 0 to 2:
0- Disabled; No change to behavior or output [DEFAULT]1- Output "plob" digest, not full SVG, when outputting file2- Disable plots and previews; generate digest only
Default: 0 (Disabled), set in nextdraw_conf.py or your
specified config file.
webhook
webhookExample 1: Plot a file and generate a webhook notification, to a specific URL when the plot finishes.
nextdraw file.svg --webhook --webhook_url "https://url.to.post.to/"
Example 2: The same, using short codes
nextdraw file.svg -WU "https://url.to.post.to/"
Enable webhook alerts
Syntax: [-W, --webhook]
If the webhook option is enabled and an URL is provided via the
webhook_url option, then the software will post to
that URL when a plot completes.
This feature can be used in combination with various services including ntfy and other well known ones like IFTTT and Zapier, to provide various forms of notifications such as email alerts, mobile alerts, or integration with other hardware or software.
When enabled, webhook alerts are only generated when a plot finishes (or is paused) and all three of these conditions are met:
- When actually plotting to the NextDraw (not in
previewmode), - In a mode that plots a document:
plot(default),layers, orres_plot, and - An URL is provided via the
webhook_urloption.
The data posted to the URL is JSON formatted and contains the following key/value pairs:
| Key | Value |
|---|---|
value1 |
Document name |
value2 |
Elapsed time |
value3 |
Port (if provided) |
The "Port" value here is taken from the port option. If you are operating multiple
named NextDraw machines, this value can be used to indicate which machine
has completed a plot.
Webooks may be enabled by using the --webhook option (-W). It is
a simple "flag" type argument, and takes no value argument.
To enable this option by default, edit nextdraw_conf.py or your
specified config file and change the value of
webhook from False to True.
webhook_url
webhook_urlExample: Plot a file and generate a webhook notification, to a specific URL when the plot finishes.
nextdraw file.svg --webhook --webhook_url "https://url.to.post.to/"
Example 2: The same, using short codes
nextdraw file.svg -WU "https://url.to.post.to/"
URL for webhook alerts
Syntax: [-U, --webhook_url] value
The URL to post data to, if the webhook option is enabled.
The webhook option has no effect unless a URL is also provided, via this option.
An extended discussion about webhooks, including instructions for setting up mobile/online notifications, is available in section "6.7 Notifications settings" of the Bantam Tools NextDraw User Guide.
Default: None, set in nextdraw_conf.py or your
specified config file.
Multiple NextDraw units
There are two main strategies for working with multiple machines with nextdraw:
(A) Launch multiple instances of nextdraw, using the --port argument to select
different machines.
This method is straightforward, and can be used to send different files to different NextDraw units.
(B) Use --port_config 3 (or -P3) to simultaneously plot the same file to
all machines units located via USB.
This method is a production-oriented choice for plotting the same document multiple times. While efficient, it uses the same interface that is normally used for working with a single NextDraw, and that does have some side-effects:
- The pause/resume feature is not fully supported with
-P3, and - Most output messages (other than errors) are suppressed.
The reason for these changes is that there is still — even when plotting to multiple machines — a maximum of one output file generated. (One of the plot processes, chosen automatically, will be the one that saves the output file.) That output file may safely be used for things like plot previews. However if the plot is paused (by Control+C or the physical pause button) while plotting in -P3 mode, then the output file saved may or may not contain plot progress data for that particular NextDraw.
If you plot with option -P3 in mode res_plot, the software
will automatically revert to -P1 mode instead, plotting to only the first
NextDraw located.
For related reasons, most output messages other than errors are suppressed to avoid duplicate warning messages during the plot. Thus, if you need to request (e.g.) the firmware version from each NextDraw, do so individually.
Migrating from AxiDraw API
If you are updating from the AxiDraw CLI or Python API, please see our separate documentation on migrating from AxiDraw APIs.
API Changelog
Revision Notes: Summary of changes affecting API.
The changelog.txt file included with the download includes additional details.
v 1.5 (2025-07)
Bug fix and compatibility update.
Archived release here.
v 1.4 (2025-03)
Change to homing behavior: If any of the Walk Carriage commands
(walk_x, walk_y, walk_mmx, walk_mmy, walk_home) are used when both (1) automatic homing is enabled
and (2) the carriage has not already been homed, the automatic homing sequence will
run before executing that command.
Updates to how manual homing, and XY offsets, can be used to offset the "local origin" when starting a plot, to better match the behavior specified in this documentation.
New set_home utility command added.
Remove support for python 3.8, add support for Python 3.13. Python versions 3.9 - 3.13 are currently supported. (Python 3.8 end of life was on 2024-10-07.)
Archived release here.
v 1.3 (2024-07)
NextDraw Layer Control now supports different optimization levels by layer.
Archived release 1.3.0 here.
Bug fix update 1.3.2 (October 2024) here
v 1.1 (2024-06)
Initial public release of this software. As of this release, Python versions 3.8 - 3.12 are currently supported.
Archived release here.
Copyright
Documentation Copyright 2025 Windell H. Oskay, Bantam Tools. All rights reserved.