Skip to content

Tcl Command Reference

Marius Stanciu edited this page Oct 29, 2026 · 1 revision

The Tcl commands control the program from the Tcl Shell or from a script. See Tcl Scripting for how to write and run a script. This page lists 84 commands.

Each command has one or more names (aliases). Use any of the aliases shown in an entry. Positional arguments come first. Options start with a dash, for example -outname name. Use True or 1 for yes, and False or 0 for no. Lengths are in mm. In a project with inch units, lengths are in inch.

Common option: commands that run in the background accept -timeout <milliseconds>. It sets the maximum wait before a timeout error. The default is the global_background_timeout preference. The entries that accept it say so.

Alphabetical index

Command Group Summary
add_aperture Object creation Adds an aperture to a Gerber object
add_circle Object creation Adds a circle to a Geometry object
add_drill Object creation Adds a drill hole to an Excellon object
add_polygon Object creation Adds a polygon to a Geometry object
add_polyline Object creation Adds a polyline to a Geometry object
add_rect Object creation Adds a rectangle to a Geometry object
add_slot Object creation Adds a slot to an Excellon object
aligndrill PCB operations Creates an Excellon object with drills for alignment
aligndrillgrid PCB operations Creates an Excellon object with drills for alignment in a grid of rows and columns
bbox Object access and misc Creates a rectangular Geometry object around a Gerber or Geometry object
bounds Object access and misc Returns the bounds of each named object
buffer Geometry operations Buffers the geometry of a Geometry, Gerber or Excellon object by a distance
check_rules PCB operations Runs the design rules check (Check Rules) on Gerber and Excellon objects
clear System and settings Clears the text in the Tcl Shell
close_project Project Closes and removes a project of the Project tab
cncjob CNC Creates a CNCJob object from a Geometry object
cutout PCB operations Creates a board cutout from an object
delete Object access and misc Deletes one object
drillcncjob CNC Generates a Drill CNC Job from an Excellon object
etch_compensate PCB operations Compensates the etching of a Gerber object
export_dxf Export Exports Gerber, Excellon, Geometry or CNCJob objects to a DXF file
export_exc Export Exports an Excellon object to an Excellon file
export_gcode CNC Returns the G-code of a CNC Job object as text
export_grb Export Exports a Gerber object to a Gerber file
export_svg Export Exports a Geometry object to an SVG file
exteriors Geometry operations Creates a Geometry object with the outer rings of the polygons of a Geometry object
extract PCB operations Extracts drills, a soldermask or a cutout outline from a Gerber object (the Extract plugin)
follow PCB operations Creates a Geometry object that follows the paths of a Gerber object
geo_union Geometry operations Joins the overlapping elements of a Geometry object into single polygons (union)
geoc PCB operations Creates a board cutout from an object of any shape
get_active Object access and misc Returns the name of the active (selected) object
get_names Object access and misc Returns the names of all objects in the project
get_path System and settings Returns the default folder that the Tcl Shell uses for opening files
get_sys System and settings Returns the value of one system variable
help System and settings Shows the list of Tcl commands
import_svg Open and import Imports an SVG file as a Geometry object or as a Gerber object
interiors Geometry operations Creates a Geometry object with the interior rings (holes) of the polygons of a Geometry object
invert_gerber PCB operations Inverts the copper of a Gerber object (the Invert Gerber plugin)
isolate PCB operations Creates isolation routing geometry for the specified Gerber object
join_excellon Geometry operations Merges the drills of two or more Excellon objects into a new Excellon object
join_geometry Geometry operations Merges two or more Geometry objects into a new Geometry object
join_gerber Geometry operations Merges two or more Gerber objects into a new Gerber object
list_pp CNC Writes the names of the available preprocessors to the Tcl Shell
list_projects Project Returns the names of the projects in the Project tab
list_sys System and settings Returns the names of the system variables
milldrills CNC Creates a Geometry object that mills the drill holes of an Excellon object
millslots CNC Creates a Geometry object that mills the slots of an Excellon object
mirror Geometry operations Mirrors the geometry of one or more named objects
ncc_clear PCB operations Clears excess copper in polygons
new Object creation Starts a new project and clears all objects from memory
new_excellon Object creation Creates a new empty Excellon object
new_geometry Object creation Creates a new empty Geometry object
new_gerber Object creation Creates a new empty Gerber object
nregions Geometry operations Creates a Geometry object with the non-copper area of a Gerber or Geometry object
offset Geometry operations Moves one or more named objects on the X axis, the Y axis or both
open_dxf Open and import Opens a DXF file as a Geometry object or as a Gerber object
open_excellon Open and import Opens an Excellon file
open_folder System and settings Opens a folder browser dialog
open_gcode Open and import Opens a G-code file
open_gerber Open and import Opens a Gerber file
open_project Project Opens a project file and recreates its objects
open_svg Open and import Opens an SVG file as a Geometry object or as a Gerber object
options System and settings Returns the settings of one object as text
paint PCB operations Paints the polygons of the specified object
panelize PCB operations Creates a new object that holds a grid of copies of the source object
plot_all Object access and misc Plots all objects in the application canvas
plot_objects Object access and misc Plots the named objects in the application canvas
qrcode PCB operations Inserts a QR code into a Gerber object
quit_app System and settings Quits the application from the Tcl Shell
save_project Project Saves the application project to a file
save_sys System and settings Saves the current system variables to the defaults file
scale Geometry operations Resizes one or more named objects by a factor on the X and Y axes, from a scale origin
select_project Project Makes the project with the given name the active project
set_active Object access and misc Sets the object with the given name as the active (selected) object in the application
set_origin Geometry operations Moves all loaded objects, or one object with -obj_name, so that the lower left corner of the bounding box is at a given x,y point (mm)
set_path System and settings Sets the default folder for the Tcl Shell
set_sys System and settings Sets the value of one system variable in the running session
skew Geometry operations Skews (shears) one or more named objects along the X and Y axes, from a skew origin
split_geometry Geometry operations Creates one new Geometry object for each tool of a Geometry object
subtract_objects Geometry operations Subtracts the area of one or more objects from a target object
subtract_poly Geometry operations Subtracts a polygon from a Geometry object
subtract_rectangle Geometry operations Subtracts a rectangle from a Geometry object
version System and settings Returns the program version as text
write_gcode CNC Saves the G-code of a CNC Job object to a file

Open and import

open_gerber

Class TclCommandOpenGerber · Source tclCommands/TclCommandOpenGerber.py

Opens a Gerber file. Parses the file and creates a Gerber object from it. The object is not plotted.

Aliases: open_gerber

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the file to open. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
outname Option (-outname value) str no File name with extension Name of the resulting Gerber object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).
follow Option (-follow) — no — Obsolete. Not accepted. The parser rejects it as an unknown parameter. Use the follow parameter of isolate().

Examples:

open_gerber gerber_object_path -outname bla
open_gerber "D:\my_gerber_file with spaces in the name.GRB"

open_excellon

Class TclCommandOpenExcellon · Source tclCommands/TclCommandOpenExcellon.py

Opens an Excellon file. Parses the file and creates an Excellon object from it. The object is not plotted.

Aliases: open_excellon

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the file to open. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
outname Option (-outname value) str no File name with extension Name of the resulting Excellon object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

open_excellon D:\my_excellon_file.DRL
open_excellon "D:\my_excellon_file with spaces in the name.DRL"
open_excellon path_to_file

open_gcode

Class TclCommandOpenGCode · Source tclCommands/TclCommandOpenGCode.py

Opens a G-code file. Parses the file and creates a CNCJob object from it. The text of the file is kept as it is. The object is not plotted.

Aliases: open_gcode

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the file to open. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
outname Option (-outname value) str no File name with extension Name of the resulting CNCJob object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

open_gcode D:\my_gcode_file.NC
open_gcode "D:\my_gcode_file with spaces in the name.TXT"

open_dxf

Class TclCommandOpenDXF · Source tclCommands/TclCommandOpenDXF.py

Opens a DXF file as a Geometry object or as a Gerber object. Text in the file is converted by the mode set in text_mode. The object is not plotted.

Aliases: open_dxf

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the file to open. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
type Option (-type value) str no geometry Kind of the new object. geometry creates a Geometry object. gerber creates a Gerber object. Any other value fails.
outname Option (-outname value) str no File name with extension Name of the resulting object.
text_mode Option (-text_mode value) str no stroke How text is imported. stroke converts text to CNC paths. outline converts text to filled shapes. none skips text. Any other value fails.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

open_dxf /path/to/file.DXF
open_dxf /path/to/file.DXF -type gerber
open_dxf /path/to/file.DXF -text_mode outline
open_dxf /path/to/file.DXF -text_mode none  # Skip text, import geometry only

open_svg

Class TclCommandOpenSVG · Source tclCommands/TclCommandOpenSVG.py

Opens an SVG file as a Geometry object or as a Gerber object. Drill markers in the file are imported too. The object is not plotted.

Aliases: open_svg

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the file to open. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
type Option (-type value) str no geometry Kind of the new object. geometry creates a Geometry object. gerber creates a Gerber object. Any other value fails.
outname Option (-outname value) str no File name with extension Name of the resulting Geometry object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

open_svg D:\my_beautiful_svg_file.SVG

import_svg

Class TclCommandImportSvg · Source tclCommands/TclCommandImportSvg.py

Imports an SVG file as a Geometry object or as a Gerber object. Drill markers in the file are imported too. The object is not plotted. The command fails if the new object is not a Geometry object.

Aliases: import_svg

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the file to import. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
type Option (-type value) str no geometry Kind of the new object. geometry creates a Geometry object. gerber creates a Gerber object. Any other value fails.
outname Option (-outname value) str no File name with extension Name of the resulting Geometry object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

import_svg D:\my_beautiful_svg_file.SVG

Export

export_grb

Class TclCommandExportGerber · Source tclCommands/TclCommandExportGerber.py

Exports a Gerber object to a Gerber file. The file is written without a thread. The command does not add an extension to the file name.

Aliases: export_grb, egr, export_gerber

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber object to export.
filename Positional str no global_last_save_folder preference, then / and the object name Absolute path to the file to export. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.

Examples:

export_gerber my_gerber path/my_file.gbr

export_exc

Class TclCommandExportExcellon · Source tclCommands/TclCommandExportExcellon.py

Exports an Excellon object to an Excellon file. The file is written without a thread. The command does not add an extension to the file name.

Aliases: export_exc, ee, export_excellon

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Excellon object to export.
filename Positional str no global_last_save_folder preference, then / and the object name Absolute path to the file to export. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.

Examples:

export_excellon my_excellon path/my_file.drl
export_excellon My_Excellon D:/drill_file.DRL

export_svg

Class TclCommandExportSVG · Source tclCommands/TclCommandExportSVG.py

Exports a Geometry object to an SVG file. The scale_stroke_factor option scales the line widths in the file.

Aliases: export_svg

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to export.
filename Positional str no global_last_save_folder preference, then / and the object name Absolute path to the file to export. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
scale_stroke_factor Option (-scale_stroke_factor value) float no 0.0 Multiplication factor for the line widths. A value of 0.0, or no value, passes 0.0 to the export handler.

Examples:

export_svg my_geometry my_file.svg

export_dxf

Class TclCommandExportDXF · Source tclCommands/TclCommandExportDXF.py

Exports Gerber, Excellon, Geometry or CNCJob objects to a DXF file. A comma-separated list of names exports all of them into one file.

Aliases: export_dxf, edxf

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber, Excellon, Geometry or CNCJob object to export. Separate several names with commas to export them into one file.
filename Positional str no global_last_save_folder preference, then / and the first object name Absolute path to the file to export. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started. The .dxf extension is added when the name has no extension.

Examples:

export_dxf my_geo path/my_file.dxf
export_dxf my_geo D:/my_file.dxf
export_dxf geo1,gerber1 D:/all.dxf

Project

open_project

Class TclCommandOpenProject · Source tclCommands/TclCommandOpenProject.py

Opens a project file and recreates its objects. The command waits until the load ends. If some objects cannot load, the command returns their names. The command fails if the file cannot open or the load times out.

Aliases: open_project

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the project file to open. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.
timeout Option (-timeout value) int no global_background_timeout preference, else 600000 ms Maximum wait in milliseconds (1 to 2147483647).

Examples:

open_project D:\my_project_file.FlatPrj
open_project "D:\my_project_file with spaces in the name.FlatPrj"

save_project

Class TclCommandSaveProject · Source tclCommands/TclCommandSaveProject.py

Saves the application project to a file.

Aliases: save_project

Required arguments: filename

Argument Kind Type Required Default Description
filename Positional str yes — Absolute path to the project file to save. Enclose the path in quotes. A relative path resolves from the folder where FlatCAM started.

Examples:

save_project D:\my_project_file.FlatPrj
save_project "D:\my_project_file with spaces in the name.FlatPrj"
save_project path_to_where_the_file_is_stored

close_project

Class TclCommandCloseProject · Source tclCommands/TclCommandCloseProject.py

Closes and removes a project of the Project tab. There is no dialog. If the project has unsaved changes, the command fails unless -force is set. If the last project closes, 1 empty project replaces it. Without a name, the command closes the active project.

Aliases: close_project

Required arguments: None

Argument Kind Type Required Default Description
name Positional str no Active project Name of the project to close.
force Option (-force, or -force value) bool no False Closes a project with unsaved changes. The changes are lost. A bare -force means True. Values: 1, 0, true, false, yes, no, on, off.

Examples:

close_project
close_project Board_B
close_project Board_B -force 1

select_project

Class TclCommandSelectProject · Source tclCommands/TclCommandSelectProject.py

Makes the project with the given name the active project. The command fails if no project has that name. The command also fails if a task is running.

Aliases: select_project

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the project to make active.

Examples:

select_project Board_B

list_projects

Class TclCommandListProjects · Source tclCommands/TclCommandListProjects.py

Returns the names of the projects in the Project tab. The names follow the order of the Project combo box. The result is one string. The names are separated by a newline character (\n).

Aliases: list_projects

Required arguments: None

This command takes no arguments.

Examples:

list_projects

Object creation

new

Class TclCommandNew · Source tclCommands/TclCommandNew.py

Starts a new project and clears all objects from memory. Each option needs a value. A bare option fails.

Aliases: new

Required arguments: None

Argument Kind Type Required Default Description
reset Option (-reset value) bool no True Re-creates the Tcl environment. All Tcl variables reset.
keep_scripts Option (-keep_scripts value) bool no False Keeps all Script objects in the new project.

Examples:

new
new -reset False
new -keep_scripts False

new_gerber

Class TclCommandNewGerber · Source tclCommands/TclCommandNewGerber.py

Creates a new empty Gerber object.

Aliases: new_gerber

Required arguments: None

Argument Kind Type Required Default Description
name Positional str no new_grb Name of the new object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

new_gerber
new_gerber my_new_gerber_name

new_excellon

Class TclCommandNewExcellon · Source tclCommands/TclCommandNewExcellon.py

Creates a new empty Excellon object.

Aliases: new_excellon

Required arguments: None

Argument Kind Type Required Default Description
name Positional str no new_exc Name of the new object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

new_excellon my_excellon
new_excellon

new_geometry

Class TclCommandNewGeometry · Source tclCommands/TclCommandNewGeometry.py

Creates a new empty Geometry object.

Aliases: new_geometry

Required arguments: None

Argument Kind Type Required Default Description
name Positional str no new_geo Name of the new object.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

new_geometry
new_geometry my_new_geo

add_aperture

Class TclCommandAddAperture · Source tclCommands/TclCommandAddAperture.py

Adds an aperture to a Gerber object. The command fails if the object is not a Gerber object. The aperture ID must be 10 or higher and must not be in use.

Aliases: add_aperture

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber object to add the aperture to.
apid Option (-apid value) int no 10, or the highest existing ID plus 1 Aperture ID. Must be 10 or higher. Must not be in use.
type Option (-type value) str no C Aperture type. C is circular. R is rectangular. O is oblong. Quotes around the value are removed. Any other value fails.
size Option (-size value) float no 0.6 Diameter of a circular aperture (C). Must be positive and finite. Not used for R or O.
width Option (-width value) float no — Width of an R or O aperture. Required for R and O. Must be positive and finite. Not used for C.
height Option (-height value) float no — Height of an R or O aperture. Required for R and O. Must be positive and finite. Not used for C.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

add_aperture gerber_name -apid 10 -type 'C' -size 1.0

add_circle

Class TclCommandAddCircle · Source tclCommands/TclCommandAddCircle.py

Adds a circle to a Geometry object. The command fails if the object is not a Geometry object. The radius must be positive.

Aliases: add_circle

Required arguments: name, center_x, center_y, radius

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to add the circle to.
center_x Positional float yes — X coordinate of the circle center.
center_y Positional float yes — Y coordinate of the circle center.
radius Positional float yes — Radius of the circle. Must be positive.

Examples:

add_circle geo_name 1.0 2.0 3

add_polygon

Class TclCommandAddPolygon · Source tclCommands/TclCommandAddPolygon.py

Adds a polygon to a Geometry object. Give the points as positional coordinates or with -p_coords, not both. The polygon needs at least 3 points. The points must form a valid polygon with an area above zero.

Aliases: add_polygon, add_poly

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to add the polygon to.
xi yi Positional (repeated pairs) float yes, when -p_coords is not used — Coordinates of the polygon points, as x and y pairs.
p_coords Option (-p_coords value) str (list of tuples) no — List of (x, y) tuples, for example "(5.0, 5.0), (6.0, 5.0), (6.0, 6.0)". Do not use the brackets [ or ]. Enclose the value in quotes when it has spaces.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

add_polygon <name> <x0> <y0> <x1> <y1> <x2> <y2> [x3 y3 [...]]
add_poly <name> -p_coords "(5.0, 5.0), (6.0, 5.0), (6.0, 6.0), (5.0, 6.0), (5.0, 5.0)"

add_polyline

Class TclCommandAddPolyline · Source tclCommands/TclCommandAddPolyline.py

Adds a polyline to a Geometry object. The command fails if the object is not a Geometry object. The polyline needs at least 2 different points.

Aliases: add_polyline

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to add the polyline to.
xi yi Positional (repeated pairs) float yes — Coordinates of the polyline points, as x and y pairs. The count of values must be even.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

add_polyline <name> <x0> <y0> <x1> <y1> <x2> <y2> [x3 y3 [...]]

add_rect

Class TclCommandAddRectangle · Source tclCommands/TclCommandAddRectangle.py

Adds a rectangle to a Geometry object. The command fails if the object is not a Geometry object. The width and the height must not be zero.

Aliases: add_rect, add_rectangle

Required arguments: name, x0, y0, x1, y1

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to add the rectangle to.
x0 Positional float yes — X coordinate of the bottom left corner.
y0 Positional float yes — Y coordinate of the bottom left corner.
x1 Positional float yes — X coordinate of the top right corner.
y1 Positional float yes — Y coordinate of the top right corner.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

add_rectangle geo_name 0 0 10 10

add_drill

Class TclCommandAddDrill · Source tclCommands/TclCommandAddDrill.py

Adds a drill hole to an Excellon object. The command fails if the object is not an Excellon object. If the diameter already exists, the drill joins that tool. If the same drill already exists, the command reports an error. The command returns the geometry of the object.

Aliases: add_drill

Required arguments: name, dia

Argument Kind Type Required Default Description
name Positional str yes — Name of the Excellon object to add the drill to.
dia Option (-dia value) float yes — Tool diameter. Must be positive.
x Option (-x value) float no 0.0 X coordinate of the drill hole.
y Option (-y value) float no 0.0 Y coordinate of the drill hole.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

add_drill excellon_name -dia 0.8 -x 13.3 -y 6.2

add_slot

Class TclCommandAddSlot · Source tclCommands/TclCommandAddSlot.py

Adds a slot to an Excellon object. The command fails if the object is not an Excellon object. The start and stop points must differ. If the diameter already exists, the slot joins that tool. If the same slot already exists, the command reports an error. The command returns the geometry of the object.

Aliases: add_slot

Required arguments: name, dia, startx, starty, stopx, stopy

Argument Kind Type Required Default Description
name Positional str yes — Name of the Excellon object to add the slot to.
dia Option (-dia value) float yes — Tool diameter. Must be positive.
startx Option (-startx value) float yes — X coordinate of the slot start point.
starty Option (-starty value) float yes — Y coordinate of the slot start point.
stopx Option (-stopx value) float yes — X coordinate of the slot stop point.
stopy Option (-stopy value) float yes — Y coordinate of the slot stop point.
timeout Option (-timeout value) int no global_background_timeout preference Maximum wait in milliseconds (1 to 2147483647).

Examples:

add_slot excellon_name -dia 0.8 -startx 1 -starty 1 -stopx 1.3 -stopy 1

PCB operations

isolate

Class TclCommandIsolate · Source tclCommands/TclCommandIsolate.py

Creates isolation routing geometry for the specified Gerber object. The result is a Geometry object. Several Gerber objects can be given at once.

Aliases: isolate

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber object to isolate. Give several names as a comma separated list with no spaces. Each Gerber gets its own result.
dia Option (-dia) str no from preferences Tool diameter. Must not be 0. A negative value isolates inside the copper features. The stored diameter is positive. With -rest 1, give a comma separated list with no spaces, for example 0.4,0.2,0.1. Not used for a V-shaped tool.
passes Option (-passes) int no — Number of passes of tool width. Must be 1 or more.
overlap Option (-overlap) float no — Overlap of each pass over the previous pass, as a percentage of the tool diameter. Range 0 to less than 100. Example: -overlap 25 is 25 percent.
combine Option (-combine) bool no — 1 combines all passes into one Geometry object. 0 creates one Geometry object for each pass, named <outname>_<pass number>.
outname Option (-outname) str no — Name of the resulting Geometry object. With several Gerber objects, the Gerber name is added: <outname>_<gerber name>.
iso_type Option (-iso_type) int no — 0 isolates the exteriors. 1 isolates the interiors. 2 does full isolation. Other values are rejected.
clear_leftovers Option (-clear_leftovers) bool no — 1 adds paths that clear the copper left where the passes of two features meet. Used with full isolation and combined passes.
boundary Option (-boundary) str no — Name of a Gerber or Geometry object whose outline limits the isolation, for example the board outline. Paths outside the outline are cut off. The passes stop when a pass is completely outside it.
trace_boundary Option (-trace_boundary) bool no — 1 adds one path along the boundary outline. 0 does not.
milling_type Option (-milling_type) str no — cl for climb milling. cv for conventional milling. The words climb and conventional are also accepted.
pad_passes Option (-pad_passes) int no — Number of extra passes around the pads only, after the last pass. Must be 0 or more.
tool_shape Option (-tool_shape) str no — Shape of the tool tip: C1, C2, C3, C4, B, V or L. For V, the effective diameter is computed from -vtipdia, -vtipangle and -cutz.
vtipdia Option (-vtipdia) float no — Tip diameter of the V-shaped tool. Must be above 0. Giving it selects the V shape.
vtipangle Option (-vtipangle) float no — Tip angle of the V-shaped tool, in degrees. Must be greater than 0 and less than 180.
cutz Option (-cutz) float no — Cut depth. Used with the V-shaped tool to find its effective diameter.
simplify Option (-simplify) float no see description Simplification tolerance of the result paths. 0 switches simplification off. Must not be negative. If not given, the value is tools_iso_simplification_tol when tools_iso_simplification is on. Otherwise it is 0.
except_obj Option (-except_obj) str no — Name of a Gerber or Geometry object whose area is excluded. The isolation paths are cut off inside it.
rest Option (-rest) bool no 0 Rest machining. The Gerber is isolated with each tool of the -dia list, largest first. Each next tool isolates what the previous tool could not. One Geometry object holds all tools.
timeout Option (-timeout) int no global_background_timeout Maximum wait in milliseconds before a timeout error. Added by the base class for commands that run in the background. Must be between 1 and 2147483647.

Examples:

isolate my_gerber -dia 0.1 -passes 2 -overlap 10 -combine True -iso_type 2 -outname out_geo
isolate my_gerber -dia 0.1 -passes 20 -overlap 10 -clear_leftovers True
isolate my_gerber -dia 0.1 -passes 50 -overlap 10 -boundary my_edge_cuts -trace_boundary True
isolate my_gerber -dia 0.4,0.2,0.1 -rest True
isolate my_gerber -tool_shape V -vtipdia 0.1 -vtipangle 30 -cutz -0.07 -milling_type cv
isolate gerber_top,gerber_bottom -dia 0.1 -pad_passes 2 -except_obj keep_out

paint

Class TclCommandPaint · Source tclCommands/TclCommandPaint.py

Paints the polygons of the specified object. The tool covers each polygon with toolpaths. By default, all polygons are painted. Use only one of -single, -ref (or -box) or -area to limit the selection.

Aliases: paint

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the source Geometry object. A Gerber object is also accepted.
tooldia Option (-tooldia) str no tools_paint_tooldia Tool diameter. Give a comma separated list for several tools, with no spaces, for example 0.5,1. Diameters must be positive. Equal diameters after rounding count as one tool.
overlap Option (-overlap) float no tools_paint_overlap Overlap of each pass over the previous pass, as a percentage of the tool diameter. Range 0 to less than 100. Example: -overlap 25 is 25 percent.
order Option (-order) str no tools_paint_order Order of the tools. no uses the given order. fwd sorts from smallest to largest. rev sorts from largest to smallest. The values 0, 1 and 2 are also accepted for no, fwd and rev.
offset Option (-offset) float no tools_paint_offset Distance from the polygon border where painting starts. Must be a finite number.
method Option (-method) str no tools_paint_method Painting algorithm: standard, seed, lines, laser_lines or combo.
connect Option (-connect) bool no tools_paint_connect 1 draws lines that connect the paths to minimize tool lifts. 0 does not.
contour Option (-contour) bool no tools_paint_contour 1 cuts around the perimeter of the painting. 0 does not.
rest Option (-rest) bool no tools_paint_rest 1 uses rest machining. 0 does not.
rest_offset Option (-rest_offset) float no tools_paint_rest_offset (fallback 0.0) Distance from the polygon border kept by rest machining.
simplification Option (-simplification) float no tools_paint_simplification Tolerance for simplifying the toolpaths, in the units of the object. Must be 0 or more. The preference is in mm. With inch units it is converted.
final_cleanup Option (-final_cleanup) bool no tools_paint_final_cleanup 1 paints the reachable gaps after painting, with the smallest tool. 0 does not.
all Option (-all), value optional flag no — Compatibility flag. A bare -all is accepted. Its value is ignored, even 0. It does not override -single, -ref, -box or -area.
ref Option (-ref) str no — Name of the object used as the paint reference. Do not use it together with -box.
box Option (-box) str no — Same as -ref. Kept for backward compatibility.
area Option (-area) str no — Rectangle as x0,y0,x1,y1, for example 0,0,10.5,8. Paints the polygons inside it. No spaces. Use a dot as decimal separator. The rectangle must have a width and a height.
single Option (-single) str no — One point as x,y or (x,y), for example 2.0,1.1. Paints the single polygon specified by this point. No spaces. Use a dot as decimal separator.
outname Option (-outname) str no <name>_paint Name of the resulting Geometry object. No spaces.

Examples:

paint obj_name -tooldia 0.3 -offset 0.1 -method 'seed' -all
paint obj_name -tooldia 0.3 -offset 0.1 -method 'seed' -single 3.3,2.0
paint obj_name -tooldia 1,0.3 -rest 1 -rest_offset 0.05 -area 0,0,20,10
paint obj_name -tooldia 0.3 -ref ref_obj_name -final_cleanup 1 -simplification 0.005

ncc_clear

Class TclCommandCopperClear · Source tclCommands/TclCommandCopperClear.py

Clears excess copper in polygons. It works as a negative Paint. Use one of -all, -box or -area to select the area to clear.

Aliases: ncc_clear, ncc

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the source Geometry or Gerber object.
tooldia Option (-tooldia) str no tools_ncc_tools Tool diameter. Give a comma separated list for several tools, with no spaces. Diameters must be positive.
overlap Option (-overlap) float no tools_ncc_overlap Overlap of each pass over the previous pass, as a percentage of the tool diameter. Range 0 to less than 100.
order Option (-order) str no — Order of the tools. no uses the given order. fwd sorts from smallest to largest. rev sorts from largest to smallest. The values 0, 1 and 2 are also accepted.
margin Option (-margin) float no tools_ncc_margin Bounding box margin. Must be a finite number.
method Option (-method) str no tools_ncc_method Algorithm for copper clearing: standard, seed, lines or combo.
connect Option (-connect) bool no tools_ncc_connect 1 draws lines that connect the paths to minimize tool lifts. 0 does not.
contour Option (-contour) bool no tools_ncc_contour 1 cuts around the perimeter of the cleared area. 0 does not.
offset Option (-offset) float no from preferences (Offset preferences) Clearing finishes at this distance from the copper features. Must be 0 or more. Without it, the Offset preferences apply.
rest Option (-rest) bool no tools_ncc_rest 1 uses rest machining. 0 does not.
all Option (-all), value optional flag no — Clears the whole object. A bare -all or -all 1 selects this mode. -all 0 does not. Give exactly one mode: -all, -box or -area.
box Option (-box) str no — Name of the reference object. Requires a value. Give exactly one mode: -all, -box or -area.
area Option (-area) str no — Rectangle to clear as xmin,ymin,xmax,ymax, in application units, with no spaces. xmin must be less than xmax. ymin must be less than ymax.
exclude Option (-exclude) str no — Name of a Geometry or Gerber object. Its polygons are never cleared. An object with no polygons is rejected.
iso_tooldia Option (-iso_tooldia) str no — Comma separated diameters of isolation tools. Gerber source object only. Without it, no isolation is generated. A diameter cannot be in both -tooldia and -iso_tooldia.
milling_type Option (-milling_type) str no — cl (climb) or cv (conventional). Used only with -iso_tooldia. Without it, the command fails.
final_cleanup Option (-final_cleanup) bool no from preferences 1 removes the residual copper with the smallest tool after clearing. 0 does not.
simplification Option (-simplification) float no — Maximum deviation allowed when simplifying the toolpaths, in application units. 0 disables it. Must be 0 or more.
plot Option (-plot) bool no 0 1 plots the resulting object. 0 does not.
outname Option (-outname) str no <name>_ncc, or <name>_ncc_rm with rest machining Name of the resulting Geometry object. No spaces.

Examples:

ncc obj_name -tooldia 0.3,1 -overlap 10 -margin 1.0 -method 'lines' -all
ncc gerber_name -tooldia 0.5 -iso_tooldia 0.2,0.1 -milling_type cl -area 0,0,50,30 -exclude keep_out -simplification 0.01 -plot 1

follow

Class TclCommandFollow · Source tclCommands/TclCommandFollow.py

Creates a Geometry object that follows the paths of a Gerber object. This is the Follow plugin. Values that are not given come from the Follow plugin defaults.

Aliases: follow

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber object to follow.
outname Option (-outname) str no <name> without extension, plus tools_follow_suffix Name of the resulting Geometry object.
union Option (-union) bool no tools_follow_union 1 unions the paths. The crossing lines get nodes. 0 does not.
simplify Option (-simplify) bool no tools_follow_simplification 1 simplifies the paths with -tolerance. 0 does not.
tolerance Option (-tolerance) float no tools_follow_tolerance (fallback 0.01) Simplification tolerance, in application units. Must be 0 or more.
merge Option (-merge) bool no tools_follow_merge (fallback 1) 1 joins the paths that touch each other into longer paths. 0 does not.
box Option (-box) str no — Follows only the paths inside this area, as xmin,ymin,xmax,ymax. Give four numbers. The area must have a width and a height.
apertures Option (-apertures) str no all Comma separated ids of the apertures to follow, for example 10,11. An unknown id is an error.
dia_mode Option (-dia_mode) str no tools_follow_dia_mode (fallback default) default: one tool with the tool diameter. aperture: one tool for each aperture size.
tooldia Option (-tooldia) float no first value of tools_mill_tooldia Tool diameter. Must be greater than 0.

Examples:

follow copper.gtl
follow copper.gtl -outname copper_follow -union 1 -simplify 1 -tolerance 0.02
follow copper.gtl -box 0,0,20,10 -tooldia 0.2
follow copper.gtl -apertures 10,11 -dia_mode aperture

etch_compensate

Class TclCommandEtchCompensate · Source tclCommands/TclCommandEtchCompensate.py

Compensates the etching of a Gerber object. The copper and the apertures grow by the lateral undercut. The result is a new Gerber object. This is the Etch Compensation plugin. Values that are not given come from the plugin defaults.

Aliases: etch_compensate

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber object.
outname Option (-outname) str no <name> plus tools_etch_suffix (fallback _comp) Name of the new Gerber object.
thickness Option (-thickness) float no tools_etch_thickness (fallback 18.0) Copper thickness, in microns.
mode Option (-mode) str no tools_etch_ratio (fallback factor) factor: the offset is the thickness divided by the etch factor. etchant: the etch factor comes from the etchant. manual: you give the offset. The word etch_list is also accepted for etchant.
factor Option (-factor) float no tools_etch_factor (fallback 3.0) Etch factor, which is the depth divided by the lateral undercut. Used in factor mode. Must be greater than 0.
etchant Option (-etchant) str no tools_etch_etchant (fallback cucl2) Etchant for etchant mode: cucl2, fecl3 or alkaline. Not case-sensitive.
offset Option (-offset) float no tools_etch_offset (fallback 0.0) Offset in microns, used in manual mode. Can be negative. Must not be 0.

Examples:

etch_compensate copper.gtl
etch_compensate copper.gtl -thickness 35 -mode factor -factor 2.5 -outname copper_comp
etch_compensate copper.gtl -mode etchant -etchant fecl3
etch_compensate copper.gtl -mode manual -offset 12

cutout

Class TclCommandCutout · Source tclCommands/TclCommandCutout.py

Creates a board cutout from an object. The source can be a Gerber or a Geometry object. The result is a new Geometry object.

Aliases: cutout, geocutout

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber or Geometry object to cut out.
type Option (-type) str no any Type of cutout. rect cuts a rectangle around the bounds of the object. any cuts along the object outline. Lowercase only.
dia Option (-dia) float no tools_cutout_tooldia Tool diameter. Must be greater than 0.
margin Option (-margin) float no tools_cutout_margin Margin over the bounds. Must be a finite number.
gapsize Option (-gapsize) float no tools_cutout_gapsize Size of each gap. Must be 0 or more.
gaps Option (-gaps) str no tools_cutout_gaps_ff Type of gaps, not case-sensitive. none: no gaps. tb: top and bottom. lr: left and right. 2tb: two on top and bottom. 2lr: two on left and right. 4: one on each side. 8: two on each side.
outname Option (-outname) str no <name>_cutout Name of the object to create.

Examples:

cutout cut_object -dia 1.2 -margin 0.1 -gapsize 1 -gaps "tb" -outname cutout_geo -type rect

geoc

Class TclCommandGeoCutout · Source tclCommands/TclCommandGeoCutout.py

Creates a board cutout from an object of any shape. The source can be a Gerber or a Geometry object. Gaps are cut from the geometry. The command runs in the background and accepts -timeout.

Aliases: geoc

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the object to cut out. Gerber or Geometry.
dia Option (-dia) float no tools_cutout_tooldia Tool diameter. Must be greater than 0.
margin Option (-margin) float no tools_cutout_margin Margin over the bounds. Must be a finite number.
gapsize Option (-gapsize) float no tools_cutout_gapsize Size of the gap. Must be 0 or more.
gaps Option (-gaps) str no tools_cutout_gaps_ff Type of gaps, not case-sensitive. none: no gaps. tb: top and bottom. lr: left and right. 2tb: two cuts on top and bottom. 2lr: two cuts on left and right. 4: 4 cuts. 8: 8 cuts.
outname Option (-outname) str no <name>_cutout Name of the resulting Geometry object.
timeout Option (-timeout) int no global_background_timeout Maximum wait in milliseconds before a timeout error. Added by the base class for commands that run in the background.

Examples:

#isolate margin for example from Fritzing arduino shield or any svg etc
isolate BCu_margin -dia 3 -overlap 1

#create exteriors from isolated object
exteriors BCu_margin_iso -outname BCu_margin_iso_exterior

#delete isolated object if you done need id anymore
delete BCu_margin_iso

#finally cut holding gaps
geoc BCu_margin_iso_exterior -dia 3 -gapsize 0.6 -gaps 4 -outname cutout_geo

panelize

Class TclCommandPanelize · Source tclCommands/TclCommandPanelize.py

Creates a new object that holds a grid of copies of the source object. The source can be a Geometry, Gerber or Excellon object. Use -columns, -rows or both.

Aliases: panelize, pan, panel

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the object to panelize. Geometry, Gerber or Excellon.
box Option (-box) str no the source object Name of the box object, for example a cutout. Its bounds set the grid. If not given, the source object is used.
spacing_columns Option (-spacing_columns) float no 5 Spacing between columns.
spacing_rows Option (-spacing_rows) float no 5 Spacing between rows.
columns Option (-columns) int no 1 Number of columns. Must be 1 or more. At least one of -columns or -rows is required.
rows Option (-rows) int no 1 Number of rows. Must be 1 or more. At least one of -columns or -rows is required.
outname Option (-outname) str no <name>_panelized Name of the new object.
use_thread Option (-use_thread) bool no 0 (False) 0 runs in the main thread. 1 runs in a worker thread. Accepts 0/1, True/False, yes/no and on/off.

Examples:

panelize obj_name
panel obj_name -rows 2 -columns 2 -spacing_columns 0.4 -spacing_rows 1.3 -box box_obj_name -outname panelized_name
panel obj_name -columns 2 -box box_obj_name -outname panelized_name

qrcode

Class TclCommandQRCode · Source tclCommands/TclCommandQRCode.py

Inserts a QR code into a Gerber object. The change can be undone. With -output new, it creates a new Gerber object that holds only the QR code. Values that are not given come from the QR Code plugin defaults. The position is in application units. For a PCB document target, it uses the units of that object.

Aliases: qrcode

Required arguments: data

Argument Kind Type Required Default Description
name Positional str no (yes for -output source) — Name of the target Gerber object. Required for -output source. With -output new, it is optional. If given, it sets the {object} token.
data Option (-data) str yes — Text of the QR code. The tokens {date}, {time}, {project}, {object} and {serial} are replaced.
x Option (-x) float no 0 X coordinate of the anchor point.
y Option (-y) float no 0 Y coordinate of the anchor point.
version Option (-version) int no tools_qrcode_version (fallback 0) QR version, 1 to 40. 0 means automatic.
error Option (-error) str no tools_qrcode_error (fallback L) Error correction level: L, M, Q or H.
box_size Option (-box_size) float no tools_qrcode_box_size (fallback 3.0) Size of one module, in tenths of a millimeter. Must be greater than 0.
border Option (-border) int no tools_qrcode_border_size (fallback 4) Border (quiet zone) in modules. Must be 0 or more.
polarity Option (-polarity) str no tools_qrcode_polarity (fallback pos) pos: the QR code is copper. neg: the QR code is cleared out of the copper.
rounded Option (-rounded) str no tools_qrcode_rounded (fallback s) s: square modules. r: rounded modules.
rotation Option (-rotation) int no tools_qrcode_rotation (fallback 0) Counter-clockwise rotation: 0, 90, 180 or 270.
mirror Option (-mirror) bool no tools_qrcode_mirror (fallback 0) Mirror about the vertical axis, for a bottom layer. 1 mirrors. 0 does not.
anchor Option (-anchor) str no tools_qrcode_anchor (fallback bl) Point of the QR code that is placed at x, y: bl, tl, br, tr or c.
margin Option (-margin) float no tools_qrcode_margin Clearance around the QR code. 0 or no value: the border times the module size.
output Option (-output) str no source source: changes the Gerber object (undoable). new: creates a new Gerber object.
outname Option (-outname) str no qrcode Name of the new Gerber object. Used with -output new only.
serial Option (-serial) int no tools_qrcode_serial_start (fallback 0) Value of the {serial} token.
serial_pad Option (-serial_pad) int no tools_qrcode_serial_pad (fallback 0) Zero padding width of the {serial} token. Must be 0 or more.
mask_pattern Option (-mask_pattern) str no tools_qrcode_mask_pattern (fallback auto) QR mask pattern, 0 to 7, or auto.

Examples:

qrcode board.gtl -data "{object} {serial}" -x 10 -y 10 -serial 7 -version 0 -anchor c
qrcode -data "hello" -output new -outname qr_label

invert_gerber

Class TclCommandInvertGerber · Source tclCommands/TclCommandInvertGerber.py

Inverts the copper of a Gerber object (the Invert Gerber plugin). The new Gerber object holds the area minus the copper. The area is the bounding box of the object grown by the margin, or the area of a reference object. The source object does not change. Values that are not given come from the Invert Gerber plugin defaults.

Aliases: invert_gerber

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber object.
margin Option (-margin) float no From preferences (tools_invert_margin, code fallback 0.1) Distance added around the bounding box of the object, in app units (mm).
join Option (-join) str no From preferences (tools_invert_join_style, code fallback s) Corner style of the margin. r is round. s is square (mitre). b is bevel.
reference Option (-reference) str no — (the bounding box of the source object) Name of a Gerber or Geometry object. Its area is inverted instead of the box.
ref_area Option (-ref_area) str no From preferences (tools_invert_ref_area, code fallback box) Used with -reference. box uses the bounding box of the reference. exact uses the shape of the reference.
outname Option (-outname) str no name + _inverted Name of the new Gerber object.

Examples:

invert_gerber board.gtl -margin 1 -join s
invert_gerber board.gtl -reference outline -ref_area exact -outname board_inv

extract

Class TclCommandExtract · Source tclCommands/TclCommandExtract.py

Extracts drills, a soldermask or a cutout outline from a Gerber object (the Extract plugin). Drills become an Excellon object. A soldermask or a cutout becomes a Gerber object. For drills, a Geometry object (its circles) is also accepted. Values that are not given come from the Extract plugin defaults.

Aliases: extract

Required arguments: object, type

Argument Kind Type Required Default Description
object Positional str yes — Name of the Gerber object. For -type drills, a Geometry object is also accepted.
type Option (-type) str yes — Kind of the output. drills creates an Excellon object. soldermask creates a Gerber object of the pads with clearance. cutout creates a Gerber outline of the board.
method Option (-method) str no From preferences (tools_extract_hole_type, code fallback fixed) Drills only. fixed uses the hole diameter from -dia. ring uses the annular ring from -ring. prop uses a hole size that is a percent of the pad size (-factor).
dia Option (-dia) float no From preferences (tools_extract_hole_fixed_dia, code fallback 0.5) Drills, fixed method: the hole diameter (mm).
ring Option (-ring) float no Per pad kind from preferences (tools_extract_<kind>_ring, code fallback 0.2) Drills, ring method: the annular ring (mm). When given, the same value applies to all pad kinds.
factor Option (-factor) float no From preferences (tools_extract_hole_prop_factor, code fallback 80) Drills, prop method: the hole size as a percent of the pad size.
apertures Option (-apertures) str no — (all apertures) Comma separated aperture codes to use, for example 10,11.
kinds Option (-kinds) str no From preferences (tools_extract_circular, tools_extract_oblong, tools_extract_square, tools_extract_rectangular, tools_extract_others; code fallback: circular only) Comma separated pad kinds to use: circular, oblong, square, rectangular, other.
slots Option (-slots) bool no From preferences (tools_extract_oblong_slots, code fallback 0) Drills only. 1 makes slots from the oblong pads. 0 does not.
regions Option (-regions) bool no From preferences (tools_extract_include_regions, code fallback 0) Soldermask only. 1 includes the Gerber regions. 0 does not.
clearance Option (-clearance) float no From preferences (tools_extract_sm_clearance, code fallback 0.1) Soldermask only. Grows every pad by this value (mm).
margin Option (-margin) float no From preferences (tools_extract_cut_margin, code fallback 0.1) Cutout only. The distance between the board and the cutout outline (mm).
thickness Option (-thickness) float no From preferences (tools_extract_cut_thickness, code fallback 0.1) Cutout only. The width of the outline line. Must be greater than zero.
shape Option (-shape) str no From preferences (tools_extract_cut_shape, code fallback rect) Cutout only. rect uses the bounding box. convex uses the convex hull.
outname Option (-outname) str no Object name + _extracted (drills), _esm (soldermask) or _ecut (cutout) Name of the new object.

Examples:

extract board.gbr -type drills -method fixed -dia 0.8
extract board.gbr -type drills -method ring -ring 0.25 -kinds "circular,oblong" -slots 1
extract board.gbr -type soldermask -clearance 0.1 -regions 1
extract board.gbr -type cutout -margin 1 -thickness 0.2 -shape convex -outname outline

aligndrill

Class TclCommandAlignDrill · Source tclCommands/TclCommandAlignDrill.py

Creates an Excellon object with drills for alignment. Each hole and its mirror image become drills. The mirror point is the center of the -box object, or the point given by -dist. Give the holes with -holes. Or give a grid with -grid, -gridoffset, -box and -minoffset.

Aliases: aligndrill

Required arguments: name, axis, dia

Argument Kind Type Required Default Description
name Positional str yes — Name of the source object. The command checks that the object exists. The positions come from the options.
axis Option (-axis) str yes — X or Y. A mirror across a line parallel to that axis. X mirrors the Y coordinates. Y mirrors the X coordinates.
dia Option (-dia) float yes — Tool diameter (mm). Must be greater than zero.
holes Option (-holes) str no — Hole positions as coordinate pairs, for example "(5,5),(10,5)". Required unless -grid and -gridoffset are given.
box Option (-box) str no — Name of an object (for example a cutout). Its bounding box center is the mirror point. Required with -grid.
grid Option (-grid) float no — Grid spacing of the holes along the axis (mm). Must be greater than zero. Requires -box and -minoffset.
gridoffset Option (-gridoffset) float no — Offset of the grid from the 0 position (mm). Required with -grid.
minoffset Option (-minoffset) float no — Minimum distance between the first and last hole and the board (mm). Must be zero or greater. Required with -grid.
axisoffset Option (-axisoffset) float no 0 Offset of the holes on the other axis (mm).
dist Option (-dist) float no 0.0 Distance of the mirror axis from the 0 position of the X or Y axis (mm). Used only without -box.
outname Option (-outname) str no name + _aligndrill Name of the new Excellon object.
timeout Option (-timeout) int no From preferences (global_background_timeout) Maximum wait for the command, in milliseconds. Must be from 1 to 2147483647.

Examples:

aligndrill my_object -axis X -box my_object -dia 3.125 -grid 1 -gridoffset 0 -minoffset 2 -axisoffset 2

aligndrillgrid

Class TclCommandAlignDrillGrid · Source tclCommands/TclCommandAlignDrillGrid.py

Creates an Excellon object with drills for alignment in a grid of rows and columns. All drills use the tool diameter -dia. The first drill is at the grid offset. The other drills follow the grid spacing.

Aliases: aligndrillgrid

Required arguments: dia, gridx, gridy, columns, rows

Argument Kind Type Required Default Description
dia Option (-dia) float yes — Tool diameter (mm). Must be greater than zero.
gridx Option (-gridx) float yes — Grid spacing on the X axis (mm). Must be greater than zero.
gridy Option (-gridy) float yes — Grid spacing on the Y axis (mm). Must be greater than zero.
columns Option (-columns) int yes — Number of grid holes on the X axis. Must be greater than zero.
rows Option (-rows) int yes — Number of grid holes on the Y axis. Must be greater than zero.
gridoffsetx Option (-gridoffsetx) float no 0 Offset of the grid from the origin on the X axis (mm).
gridoffsety Option (-gridoffsety) float no 0 Offset of the grid from the origin on the Y axis (mm).
outname Option (-outname) str no new_aligndrill_grid Name of the new Excellon object.

Examples:

aligndrillgrid -dia 0.8 -rows 2 -columns 2 -gridoffsetx 10 -gridoffsety 10 -gridx 2.54 -gridy 5.08

check_rules

Class TclCommandCheckRules · Source tclCommands/TclCommandCheckRules.py

Runs the design rules check (Check Rules) on Gerber and Excellon objects. A rule runs only when its value is given. Each rule needs its objects. The command reports a rule without its objects as an error. At least one rule is required. The result has one line per rule: PASSED, FAILED (n), NOTHING TO CHECK or ERROR: message. The last line holds the total number of violations.

Aliases: check_rules

Required arguments: None. At least one rule option (for example -c2c) is required.

Argument Kind Type Required Default Description
copper_top Option (-copper_top) str no — Name of the top copper Gerber object.
copper_bottom Option (-copper_bottom) str no — Name of the bottom copper Gerber object.
sm_top Option (-sm_top) str no — Name of the top solder mask Gerber object.
sm_bottom Option (-sm_bottom) str no — Name of the bottom solder mask Gerber object.
silk_top Option (-silk_top) str no — Name of the top silkscreen Gerber object.
silk_bottom Option (-silk_bottom) str no — Name of the bottom silkscreen Gerber object.
outline Option (-outline) str no — Name of the board outline Gerber object.
exc_1 Option (-exc_1) str no — Name of the first Excellon object.
exc_2 Option (-exc_2) str no — Name of the second Excellon object.
trace_size Option (-trace_size) float no — Rule: minimum trace size (mm). Checked only when given.
c2c Option (-c2c) float no — Rule: minimum copper to copper clearance (mm). Checked only when given.
c2o Option (-c2o) float no — Rule: minimum copper to outline clearance (mm). Checked only when given.
s2s Option (-s2s) float no — Rule: minimum silk to silk clearance (mm). Checked only when given.
s2sm Option (-s2sm) float no — Rule: minimum silk to solder mask clearance (mm). Checked only when given.
s2o Option (-s2o) float no — Rule: minimum silk to outline clearance (mm). Checked only when given.
sm2sm Option (-sm2sm) float no — Rule: minimum solder mask sliver (mm). Checked only when given.
ri Option (-ri) float no — Rule: minimum annular ring (mm). Checked only when given.
h2h Option (-h2h) float no — Rule: minimum hole to hole clearance (mm). Checked only when given.
dh Option (-dh) float no — Rule: minimum drill size (mm). Checked only when given.
slot Option (-slot) float no — Rule: minimum slot width (mm). Checked only when given.
h2o Option (-h2o) float no — Rule: minimum hole to outline clearance (mm). Checked only when given.
h2c Option (-h2c) float no — Rule: minimum hole to copper clearance (mm). Checked only when given.
iso Option (-iso) float no — Rule: isolation tool diameter (mm). Reports copper gaps narrower than the tool.
outname Option (-outname) str no — Optional. Name of a Document object that receives the report.
csv Option (-csv) str no — Optional. Path of a CSV file. Columns: rule, layer, x, y, value, limit, status.

Examples:

check_rules -copper_top a.GTL -outline a.GKO -exc_1 a.DRL -c2c 0.15 -c2o 0.3 -dh 0.3 -outname drc_report -csv drc.csv

Geometry operations

buffer

Class TclCommandBuffer · Source tclCommands/TclCommandBuffer.py

Buffers the geometry of a Geometry, Gerber or Excellon object by a distance. The object changes in place. No new object is created. With -factor, the distance is a scale factor. Each geometric element scales from the center of its own bounding box.

Aliases: buffer

Required arguments: name, dist

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry, Gerber or Excellon object to buffer.
dist Option (-dist) float yes — Distance to buffer each geometric element (mm). With -factor, the scale factor.
join Option (-join) str no round (1) Corner style. round or 1 is round. square, mitre or 2 is square (mitre). bevel or 3 is bevel. Other values are an error.
factor Option (-factor) bool no — (buffer by distance) 1 or true: dist is the scale factor for each geometric element. 0 or false: buffer by distance.

Examples:

# buffer each geometric element at the distance 4.2 in the my_geo Geometry obj
buffer my_geo -dist 4.2
# scale each geo element by a factor of 4.2 in the my_geo Geometry obj
buffer my_geo -dist 4.2 -factor True
buffer my_geo -dist 4.2 -factor 1
# scale each geo element by a factor of 4.2 in the my_geo Geometry obj and the join is 2 (square)
buffer my_geo -dist 4.2 -factor True -join 2

offset

Class TclCommandOffset · Source tclCommands/TclCommandOffset.py

Moves one or more named objects on the X axis, the Y axis or both. Works on Gerber, Excellon, Geometry and CNCJob objects. The objects change in place. No new object is created. The G-code of a CNCJob object is rewritten. Use quotes around object names that contain spaces.

Aliases: offset

Required arguments: None

Argument Kind Type Required Default Description
objects Positional (unnamed, one or more) str yes — Names of the objects to move. Put them after the command.
x Option (-x) float no 0.0 Offset on the X axis (mm).
y Option (-y) float no 0.0 Offset on the Y axis (mm).

Examples:

offset my_object_1 "my object_1" -x 1.2 -y -0.3
offset my_object -x 1.0

mirror

Class TclCommandMirror · Source tclCommands/TclCommandMirror.py

Mirrors the geometry of one or more named objects. Works on Gerber, Excellon, Geometry and CNCJob objects. The objects change in place. No new object is created. The G-code of a CNCJob object is rewritten. Use quotes around object names that contain spaces. The command waits for the background work to finish, and it accepts -timeout.

Aliases: mirror

Required arguments: None

Argument Kind Type Required Default Description
objects Positional (unnamed, one or more) str yes — Names of the objects to mirror. Put them after the command.
axis Option (-axis) str no — (the effect is the same as -axis X) X flips the X coordinates. Y flips the Y coordinates. The code swaps the letter before it calls the mirror method.
box Option (-box) str no — Name of an object (for example a cutout). Its bounding box center is the mirror point. Takes precedence over -origin.
origin Option (-origin) str no Center of the bounding box of all objects Mirror point, used only without -box. origin is point (0, 0). min_bounds is the lower left point of the bounding box of all objects. center is the center of that box. Or give x,y with no spaces, for example 3.2,4.7.
timeout Option (-timeout) int no From preferences (global_background_timeout) Maximum wait for the command, in milliseconds. Must be from 1 to 2147483647.

Examples:

mirror obj_name -box box_geo -axis X
mirror obj_name -axis X -origin 3.2,4.7

scale

Class TclCommandScale · Source tclCommands/TclCommandScale.py

Resizes one or more named objects by a factor on the X and Y axes, from a scale origin. Works on Gerber, Excellon, Geometry and CNCJob objects. The objects change in place. No new object is created. The G-code of a CNCJob object is rewritten. Use quotes around object names that contain spaces.

Aliases: scale

Required arguments: None. At least one of -factor, -x or -y is required.

Argument Kind Type Required Default Description
objects Positional (unnamed, one or more) str yes — Names of the objects to scale. Put them after the command.
factor Option (-factor) float no — Scale factor for both axes. When given, -x and -y are ignored.
x Option (-x) float no — Scale factor on the X axis. Used only without -factor. If -y is not given, the Y axis keeps a factor of 1.
y Option (-y) float no — Scale factor on the Y axis. Used only without -factor. If -x is not given, the X axis keeps a factor of 1.
origin Option (-origin) str no center (center of the bounding box of all objects) Scale origin. origin is point (0, 0). min_bounds is the lower left point of the bounding box of all objects. center is the center of that box. Or give x,y with no spaces, for example 3.0,2.1.

Examples:

scale my_obj_1 "my obj_2" -factor 4.2
scale my_obj -x 3.1 -y 2.8
scale my_obj -factor 1.2 -origin min_bounds
scale my_object -x 2 -origin 3.0,2.1

skew

Class TclCommandSkew · Source tclCommands/TclCommandSkew.py

Skews (shears) one or more named objects along the X and Y axes, from a skew origin. Give angles with -x and -y, or distances with -x_dist and -y_dist. Do not mix the two kinds. Works on Gerber, Excellon, Geometry and CNCJob objects. The objects change in place. The G-code of a CNCJob object is rewritten. Use quotes around object names that contain spaces.

Aliases: skew

Required arguments: None

Argument Kind Type Required Default Description
objects Positional (unnamed, one or more) str yes — Names of the objects to skew. Put them after the command.
x Option (-x) float no 0.0 Skew angle on the X axis, in degrees. Do not use with -x_dist or -y_dist.
y Option (-y) float no 0.0 Skew angle on the Y axis, in degrees. Do not use with -x_dist or -y_dist.
x_dist Option (-x_dist) float no 0.0 Skew distance on the X axis (mm). The angle is computed from the height of the bounding box of all objects. Do not use with -x or -y.
y_dist Option (-y_dist) float no 0.0 Skew distance on the Y axis (mm). The angle is computed from the width of the bounding box of all objects. Do not use with -x or -y.
origin Option (-origin) str no origin (point (0, 0)) Skew origin. origin is point (0, 0). min_bounds is the lower left point of the bounding box of all objects. center is the center of that box. Or give x,y with no spaces, for example 3.0,2.1.

Examples:

skew my_obj1 "my obj_2" -x 10.2 -y 3.5
skew my_obj -x 3.0 -origin 3.0,2.1
skew my_obj -x 1.0 -origin min_bounds
skew my_obj1 "my obj2" -x_dist 3.0 -y_dist 1.0 -origin 3.0,2.1

set_origin

Class TclCommandSetOrigin · Source tclCommands/TclCommandSetOrigin.py

Moves all loaded objects, or one object with -obj_name, so that the lower left corner of the bounding box is at a given x,y point (mm). With -auto, the lower left corner goes to 0,0. Without arguments, the command sets the origin at 0,0.

Aliases: set_origin, origin

Required arguments: None.

Argument Kind Type Required Default Description
loc Positional str no — The x,y point, without spaces, for example 2,3. The lower left corner of the bounding box goes to this point.
auto Option (-auto) bool no — 1 or True: move the lower left corner of the bounding box of all objects to 0,0. 0 or False: set the origin at 0,0. When given, it is used instead of loc.
obj_name Option (-obj_name) str no — Name of a loaded Gerber, Geometry or Excellon object. Only this object moves, to loc. It works only together with loc.

Examples:

set_origin 3,2
set_origin -auto 1
origin
set_origin 10,10 -obj_name "my_top_gerber"

split_geometry

Class TclCommandSplitGeometry · Source tclCommands/TclCommandSplitGeometry.py

Creates one new Geometry object for each tool of a Geometry object. Each new object holds the geometry of one tool. The new objects are named <source name>_tool_<tool id>. The source object does not change.

Aliases: split_geometries, split_geometry

Required arguments: source_name

Argument Kind Type Required Default Description
source_name Positional str yes — Name of the source Geometry object.

Examples:

split_geometry my_geometry

subtract_objects

Class TclCommandSubtractObjects · Source tclCommands/TclCommandSubtractObjects.py

Subtracts the area of one or more objects from a target object. It can also intersect or xor the areas (the Subtract plugin). The result goes into a new object. Gerber, Geometry and Excellon objects can be used. Drills and slots of Excellon objects act as holes. Values that are not given come from the Subtract plugin defaults.

Aliases: subtract_objects, subtract

Required arguments: target, subtractors

Argument Kind Type Required Default Description
target Positional str yes — Name of the target object (Gerber, Geometry or Excellon).
subtractors Positional str yes — Names of the subtractor objects, separated by commas. Extra words after the list are added as subtractors.
op Option (-op) str no From preferences (tools_sub_operation, code fallback subtract) subtract removes the subtractor area from the target. intersect keeps only the common area. xor keeps the area that is in one object only. xor is not valid for an Excellon target.
margin Option (-margin) float no From preferences (tools_sub_margin, code fallback 0) Grows the subtractor area by this value (mm). Must not be negative.
close_paths Option (-close_paths) bool no From preferences (tools_sub_close_paths, code fallback 1) Geometry target only. 1 unites the polygons and gives polygons. 0 works on the rings.
target_tools Option (-target_tools) str no — (all tools or apertures) Comma separated ids of the target apertures or tools to change, for example 10,11. An unknown id is an error.
outname Option (-outname) str no Target name + _sub suffix from preferences (tools_sub_suffix) when keep_target is 1. Target name when keep_target is 0. Name of the new object.
keep_target Option (-keep_target) bool no From preferences (tools_sub_keep_target, code fallback 1) 1 keeps the target object. 0 deletes it, and the result takes its name.
delete_subtractors Option (-delete_subtractors) bool no From preferences (tools_sub_delete_subtractors, code fallback 0) 1 deletes the subtractor objects after the operation.
steps Option (-steps) int no Computed from the application circle steps and the largest margin or drill radius Circle steps for a whole circle, used for the shapes made from drills, slots and margins. Must be at least 4.

Examples:

subtract_objects copper.gtl mask.gts
subtract copper.gtl drills.drl,keepout -op subtract -margin 0.2 -outname copper_cut
subtract_objects board.gbr outline -op intersect -keep_target 0

subtract_poly

Class TclCommandSubtractPoly · Source tclCommands/TclCommandSubtractPoly.py

Subtracts a polygon from a Geometry object. The polygon corners are given as x,y pairs, one number after another. The Geometry object changes in place. The command runs in the background and accepts -timeout.

Aliases: subtract_poly

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to subtract from.
x0 y0 x1 y1 ... Positional (extra words) float yes — Corner coordinates as pairs, for example 0 0 2 1 3 3. At least three pairs. The count must be even. If the last point is not the first point, the polygon closes automatically.
timeout Option (-timeout) int no global_background_timeout Maximum wait in milliseconds before a timeout error. Added by the base class for commands that run in the background.

Examples:

subtract_poly my_geo 0 0 2 1 3 3 4 4 0 0

subtract_rectangle

Class TclCommandSubtractRectangle · Source tclCommands/TclCommandSubtractRectangle.py

Subtracts a rectangle from a Geometry object. The rectangle is given by two corners. The Geometry object changes in place. The command runs in the background and accepts -timeout.

Aliases: subtract_rectangle

Required arguments: name, x0, y0, x1, y1

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object to subtract from.
x0 Positional (extra word) float yes — X coordinate of the bottom left corner.
y0 Positional (extra word) float yes — Y coordinate of the bottom left corner.
x1 Positional (extra word) float yes — X coordinate of the top right corner.
y1 Positional (extra word) float yes — Y coordinate of the top right corner.
timeout Option (-timeout) int no global_background_timeout Maximum wait in milliseconds before a timeout error. Added by the base class for commands that run in the background.

Examples:

subtract_rectangle geo_obj 8 8 15 15

geo_union

Class TclCommandGeoUnion · Source tclCommands/TclCommandGeoUnion.py

Joins the overlapping elements of a Geometry object into single polygons (union). For example, two intersecting polygons become one larger polygon. The Geometry object changes in place.

Aliases: geo_union

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Geometry object whose elements are joined.

Examples:

geo_union target_geo

join_gerber

Class TclCommandJoinGerber · Source tclCommands/TclCommandJoinGerber.py

Merges two or more Gerber objects into a new Gerber object. The Gerber objects are given as names after the command. The command does not delete the source objects.

Aliases: join_gerber, join_gerbers

Required arguments: None declared. Give at least two object names as extra words.

Argument Kind Type Required Default Description
names Positional (extra words) str yes — Names of two or more Gerber objects. Enclose a name that has spaces in quotes.
outname Option (-outname) str no joined_gerber Name of the new Gerber object.

Examples:

join_gerbers grb_name_1 "grb name_2" -outname merged_new_gerber
join_gerber grb_name_1 "grb name_2"

join_excellon

Class TclCommandJoinExcellon · Source tclCommands/TclCommandJoinExcellon.py

Merges the drills of two or more Excellon objects into a new Excellon object. The Excellon objects are given as names after the command. The command does not delete the source objects.

Aliases: join_excellon, join_excellons

Required arguments: None declared. Give at least two object names as extra words.

Argument Kind Type Required Default Description
names Positional (extra words) str yes — Names of two or more Excellon objects. Enclose a name that has spaces in quotes.
outname Option (-outname) str no joined_exc Name of the new Excellon object.

Examples:

join_excellons exc_name_1 "exc name_2" -outname merged_new_excellon
join_excellon exc_name_1 "exc name_2"

join_geometry

Class TclCommandJoinGeometry · Source tclCommands/TclCommandJoinGeometry.py

Merges two or more Geometry objects into a new Geometry object. The Geometry objects are given as names after the command. All of them must be MultiGeo, or all must be SingleGeo. The new object has the same type. The command uses the geometry_merge_fuse_tools preference. The command does not delete the source objects.

Aliases: join_geometries, join_geometry

Required arguments: None declared. Give at least two object names as extra words.

Argument Kind Type Required Default Description
names Positional (extra words) str yes — Names of two or more Geometry objects. Enclose a name that has spaces in quotes.
outname Option (-outname) str no joined_geo Name of the new Geometry object.

Examples:

join_geometry geo_name_1 "geo name_2" -outname merged_new_geo

exteriors

Class TclCommandExteriors · Source tclCommands/TclCommandExteriors.py

Creates a Geometry object with the outer rings of the polygons of a Geometry object. Holes are not included. The source object does not change. The command runs in the background and accepts -timeout.

Aliases: exteriors, ext

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the source Geometry object.
outname Option (-outname) str no <name>_exteriors Name of the new Geometry object.
timeout Option (-timeout) int no global_background_timeout Maximum wait in milliseconds before a timeout error. Added by the base class for commands that run in the background.

Examples:

ext geo_source_name -outname "final_geo"

interiors

Class TclCommandInteriors · Source tclCommands/TclCommandInteriors.py

Creates a Geometry object with the interior rings (holes) of the polygons of a Geometry object. Outer rings are not included. The source object does not change. The command runs in the background and accepts -timeout.

Aliases: interiors

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the source Geometry object.
outname Option (-outname) str no <name>_interiors Name of the new Geometry object.
timeout Option (-timeout) int no global_background_timeout Maximum wait in milliseconds before a timeout error. Added by the base class for commands that run in the background.

Examples:

interiors my_geo_name -outname "outputed_geo"

nregions

Class TclCommandNregions · Source tclCommands/TclCommandNregions.py

Creates a Geometry object with the non-copper area of a Gerber or Geometry object. The area is the bounding box of the copper, grown by the margin, minus the copper. With -rounded, the outer corners are rounded. Without it, the area is a rectangle.

Aliases: non_copper_regions, ncr

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber or Geometry object.
outname Option (-outname) str no <name>_noncopper Name of the new Geometry object.
margin Option (-margin) float no From preferences (gerber_noncoppermargin) Distance from the copper bounding box to the outer edge (mm).
rounded Option (-rounded) bool no From preferences (gerber_noncopperrounded) 1 gives rounded outer corners. 0 gives square corners.

Examples:

ncr name -margin 0.1 -rounded True -outname name_ncr

CNC

cncjob

Class TclCommandCncjob · Source tclCommands/TclCommandCncjob.py

Creates a CNCJob object from a Geometry object. The command also accepts an Excellon object. It mills the holes with the Milling plugin logic. Options that you do not give keep the stored settings of the object or tool.

Aliases: cncjob

Required arguments: None declared. The command fails without name.

Argument Kind Type Required Default Description
name Positional str no (see above) — Name of the source object. A Geometry or Excellon object.
dia Option (-dia) float no tools_mill_tooldia Tool diameter. For a multi-tool Geometry the value is ignored with a warning. For a single-tool Geometry it replaces the diameter.
z_cut Option (-z_cut) float no tools_mill_cutz Z position for cutting.
z_move Option (-z_move) float no tools_mill_travelz Z position for travel moves.
feedrate Option (-feedrate) float no tools_mill_feedrate Speed on the X-Y plane when cutting.
feedrate_z Option (-feedrate_z) float no tools_mill_feedrate_z (laser preprocessors: the value of -feedrate) Speed on the Z axis when cutting.
feedrate_rapid Option (-feedrate_rapid) float no tools_mill_feedrate_rapid Rapid move speed. Used only by preprocessors that use it.
extracut_length Option (-extracut_length) float no tools_mill_extracut_length, on when tools_mill_extracut is on Enables extra cut past the first path point. A bare option uses 0.0.
dpp Option (-dpp) float no tools_mill_depthperpass; multidepth from tools_mill_multidepth Depth per pass. Enables multidepth cutting. A bare option uses tools_mill_depthperpass.
toolchangez Option (-toolchangez) float no tools_mill_toolchangez; toolchange from tools_mill_toolchange Z height for the toolchange. Enables the toolchange. A bare option uses tools_mill_toolchangez.
toolchangexy Option (-toolchangexy) str no tools_mill_toolchangexy, else 0, 0 X,Y position of the toolchange. Format: 30.0,15.2 or (30.0, 15.2). No spaces.
startz Option (-startz) float no tools_mill_startz Height before the first move. A bare option keeps None.
endz Option (-endz) float no tools_mill_endz Height where the last move parks.
endxy Option (-endxy) str no tools_mill_endxy, else 0, 0 X,Y position at job end. Same format as -toolchangexy. No spaces.
spindlespeed Option (-spindlespeed) int no None for non-laser preprocessors. Laser: the laser power of the object (tools_mill_spindlespeed) Spindle speed in rpm. For laser preprocessors, it is the laser power when -las_power is not given. A bare option uses None, or 0.0 for laser.
dwelltime Option (-dwelltime) float no tools_mill_dwelltime; dwell from tools_mill_dwell Spindle startup pause time. Enables dwell. A bare option uses the object tools_mill_dwelltime.
las_power Option (-las_power) float no Laser: see -spindlespeed Laser power when cutting. Used by laser preprocessors.
las_min_pwr Option (-las_min_pwr) float no 0.0 Laser power when not cutting (travel). Used by laser preprocessors.
pp Option (-pp) str no tools_mill_ppname_g Name of the Geometry preprocessor. Case sensitive. No quotes.
muted Option (-muted) str (1/0) no False Hides errors in the Shell. 1 (True) or 0 (False).
outname Option (-outname) str no Name of the source object with suffix _cnc Name of the resulting CNC Job object.
offset_type Option (-offset_type) str no — (the stored offset of the object or tool) Tool offset: 0 or path, 1 or in, 2 or out, 3 or custom. A multi-tool Geometry keeps the offset of each tool unless this is given.
offset_value Option (-offset_value) float no — (offset type 3, custom, when -offset_type is not given) Offset value for the custom offset type. Without -offset_type it selects custom (3).
job_type Option (-job_type) str no — (the stored job type) Job type: 0 or roughing, 1 or finishing, 2 or isolation, 3 or polishing. Polishing paints the whole bounding box of the object.
polish_margin Option (-polish_margin) float no — (the stored value) Polishing: margin added around the bounding box.
polish_overlap Option (-polish_overlap) float no — (the stored value) Polishing: overlap in percent. Range 0 to 99.
polish_method Option (-polish_method) str no — (the stored value) Polishing method: 0 or standard, 1 or seed, 2 or lines.
optimization Option (-optimization) str no — (the stored value); R without OR-Tools Path optimization: M (OR-Tools metaheuristic), B (OR-Tools basic), T (travelling salesman), R (RTree), N (none).
search_time Option (-search_time) int no — (the stored value) OR-Tools search time in seconds. Integer, 1 or more.
area_exclusion Option (-area_exclusion) str (1/0) no Uses the exclusion areas when there are any 1 uses the exclusion areas of the project. 0 ignores them.
tools Option (-tools) str no all tools Excellon only. Comma separated tool numbers to mill.
mill_dia Option (-mill_dia) float no — (the stored value) Excellon only. Diameter of the milling tool.
milling_type Option (-milling_type) str no — (the stored value) Excellon only. drills, slots, or both.
overlap Option (-overlap) float no — (the stored value) Excellon only. Overlap in percent for clearing the holes.
connect Option (-connect) str (1/0) no — (the stored value) Excellon only. Connects the clearing paths. 1 or 0.

Examples:

cncjob exc_name -mill_dia 0.8 -milling_type drills -overlap 10 -connect 1 -z_cut -1.8
cncjob geo_name -offset_type out -job_type polishing -polish_margin 1 -optimization T
cncjob geo_name -dia 0.5 -z_cut -1.8 -dpp 0.6 -z_move 2 -feedrate 120 -pp default
cncjob geo_name -dpp -toolchangez -dwelltime -extracut_length -startz -spindlespeed

drillcncjob

Class TclCommandDrillcncjob · Source tclCommands/TclCommandDrillcncjob.py

Generates a Drill CNC Job from an Excellon object. You select the tools with -drilled_dias. You can add more Excellon objects with -objects. Options that you do not give keep the stored settings of each tool.

Aliases: drillcncjob

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the source Excellon object.
drilled_dias Option (-drilled_dias) str no all Comma separated tool diameters to drill (example: 0.6,1.0). No spaces. The value all drills all tools.
objects Option (-objects) str no — Comma separated names of more Excellon objects drilled in the same job (example: board2,board3). Tools merge by diameter. The objects do not change.
area Option (-area) str no — (all holes) Drills only the holes inside the rectangle x0,y0,x1,y1 (example: 0,0,50,30).
drillz Option (-drillz) float no tools_drill_cutz of each tool Drill depth into the material for all tools (example: -2.0). A bare option uses the Cut Z of each tool.
dpp Option (-dpp) float no tools_drill_depthperpass (absolute value); multidepth from tools_drill_multidepth Depth per drilling pass (example: 0.7). Enables multidepth. A bare option uses the object value.
travelz Option (-travelz) float no tools_drill_travelz Travel height above the material (example: 2.0).
feedrate_z Option (-feedrate_z) float no tools_drill_feedrate_z Drilling feed rate on the Z axis.
feedrate_rapid Option (-feedrate_rapid) float no tools_drill_feedrate_rapid Rapid drilling feed rate. Used only by preprocessors that use it.
spindlespeed Option (-spindlespeed) int no tools_drill_spindlespeed of each tool Spindle speed in rpm (example: 4000). For laser preprocessors, it is the laser power when -las_power is not given.
toolchangez Option (-toolchangez) float no tools_drill_toolchangez; toolchange from tools_drill_toolchange Z distance for the toolchange (example: 30.0). Enables the toolchange. A bare option uses the object value.
toolchangexy Option (-toolchangexy) str no tools_drill_toolchangexy, else 0, 0 X,Y position of the toolchange. Format: 0.3,1.0 or (30.0, 15.2). No spaces.
startz Option (-startz) float no tools_drill_startz; if empty, no start Z move Z coordinate at job start. A bare option uses tools_drill_startz when it is set.
endz Option (-endz) float no tools_drill_endz Z coordinate at job end. A bare option uses tools_drill_endz.
endxy Option (-endxy) str no tools_drill_endxy, else 0, 0 X,Y position at job end. Format: 2.0,1.2 or (2.0, 1.2). No spaces.
dwelltime Option (-dwelltime) float no tools_drill_dwelltime; dwell from tools_drill_dwell Spindle startup pause time. Enables dwell. A bare option uses tools_drill_dwelltime.
las_power Option (-las_power) float no — (the tool value of spindlespeed) Laser power when cutting. Used by laser preprocessors.
las_min_pwr Option (-las_min_pwr) float no tools_drill_min_power, else 0.0 Laser power when not cutting (travel). Used by laser preprocessors. Same as -min_power.
min_power Option (-min_power) float no tools_drill_min_power, else 0.0 Same as -las_min_pwr.
laser_on Option (-laser_on) str no — Code that turns the laser on (example: M3 or M4). Used by laser preprocessors.
toolchange Option (-toolchange) str (1/0) no tools_drill_toolchange Toolchange on (1) or off (0). Setting -toolchangez or -toolchangexy turns it on when this option is omitted.
order Option (-order) str no fwd Tool order: fwd (small to big diameter), rev (big to small), or no (as in the object).
f_plunge Option (-f_plunge) str (1/0) no tools_drill_f_plunge of each tool Fast plunge. 1: after the toolchange the tool goes down to the travel Z with a rapid move.
f_retract Option (-f_retract) str (1/0) no tools_drill_f_retract of each tool Fast retract. 1: the tool goes up to the travel Z in one move. 0: it goes up to Z0 first.
spindledir Option (-spindledir) str no tools_drill_spindledir of each tool Spindle direction: CW or CCW.
offset Option (-offset) float no tools_drill_offset of each tool Offset added to the drill depth (example: 0.1).
pdepth Option (-pdepth) float no tools_drill_z_p_depth of each tool Probe depth for preprocessors with probing (example: -0.02).
pplate Option (-pplate) float no tools_drill_probe_plate of each tool Thickness of the touch plate on top of the material. Used by probing preprocessors (example: 1.5).
pfeed Option (-pfeed) float no tools_drill_feedrate_probe of each tool Probe feed rate. Used by probing preprocessors.
dwell Option (-dwell) str (1/0) no tools_drill_dwell of each tool Spindle startup pause on (1) or off (0).
dwell_bottom Option (-dwell_bottom) str (1/0) no tools_drill_dwell_bottom of each tool Dwell at the bottom of each hole. Uses the Dwelltime.
peck Option (-peck) str (1/0) no tools_drill_peck of each tool Peck drilling on (1) or off (0). Each hole is drilled in steps of -peck_depth. It replaces multidepth. Laser preprocessors ignore it.
peck_depth Option (-peck_depth) float no tools_drill_peck_depth of each tool Depth of one peck step (example: 0.5).
peck_retract Option (-peck_retract) float no tools_drill_peck_retract of each tool Clearance above the last depth to which the tool goes down fast before it feeds on (example: 0.2).
spot Option (-spot) str (1/0) no Application option Spot drilling pass on (1) or off (0). It adds one extra tool that drills all drilled holes. It needs the toolchange. Laser preprocessors ignore it.
spot_dia Option (-spot_dia) float no Application option Diameter of the spot drill (example: 0.5).
spot_cutz Option (-spot_cutz) float no Application option Cut Z of the spot holes (example: -0.3).
spot_feedrate Option (-spot_feedrate) float no Application option Feed rate Z of the spot holes.
job_offset Option (-job_offset) str no Application option Moves all drill points by dx,dy (example: 10,-5). No spaces. Done after the mirror and before the array. The object does not change.
mirror Option (-mirror) str no Application option Mirrors all drill points: no, x (Y values flip), y (X values flip), or xy.
mirror_point Option (-mirror_point) str no Center of the bounding box of the drilled holes Point x,y through which the mirror axes pass (example: 0,0).
array Option (-array) str no Application option Repeats the drill points as an array: columns,rows (example: 3,2). 1,1 is no array. Needs -array_pitch.
array_pitch Option (-array_pitch) str no Application option Distance px,py between the copies of the array (example: 10,20).
drill_slots Option (-drill_slots) str (1/0) no tools_drill_drill_slots of each tool Drills the slots as holes (1). 0 leaves them out.
overlap Option (-overlap) float no tools_drill_drill_overlap of each tool Overlap in percent of the holes that drill a slot (0 to 100).
last_drill Option (-last_drill) str (1/0) no tools_drill_last_drill of each tool Drills a hole at the end of the slot (1) or not (0).
pp Option (-pp) str no tools_drill_ppname_e Name of the Excellon preprocessor. Case sensitive. No quotes.
opt_type Option (-opt_type) str no excellon_optimization_type, else R Path optimization: R (RTree walk), B (basic OR-Tools), M (metaheuristic OR-Tools), T (travelling salesman), No (order of the holes). B and M need OR-Tools.
diatol Option (-diatol) float no — (exact match of the diameter) Tolerance in percent (0.0 to 100.0). A diameter in -drilled_dias matches a tool within this tolerance.
muted Option (-muted) str (1/0) no False Hides errors in the Shell and status bar. 1 (True) or 0 (False).
outname Option (-outname) str no Name of the source object with suffix _cnc Name of the resulting CNC Job object.

Examples:

drillcncjob test.TXT -drillz -1.5 -travelz 14 -feedrate_z 222 -feedrate_rapid 456 -spindlespeed 777 -toolchangez 33 -endz 22 -pp Marlin
Usage of -feedrate_rapid matter only when the preprocessor is using it, like -Marlin-.

drillcncjob test.DRL -drillz -1.7 -dpp 0.5 -travelz 2 -feedrate_z 800 -endxy 3,3

drillcncjob test.DRL -drilled_dias "all" -drillz -1.7 -dpp 0.5 -travelz 2 -feedrate_z 800 -endxy 3,3
drillcncjob test.DRL -dpp -toolchangez -dwelltime -drillz -startz -endz
drillcncjob test.DRL -toolchange 1 -order rev -f_plunge 1 -f_retract 0 -spindledir CCW -dwell 1 -dwelltime 1.5 -offset 0.1 -opt_type No
Without -drillz, -travelz, -feedrate_z, -spindlespeed ... each tool uses its own values.

drillcncjob test.DRL -drillz -3 -peck 1 -peck_depth 1 -peck_retract 0.3 -dwell_bottom 1 -dwelltime 0.5

drillcncjob test.DRL -toolchange 1 -spot 1 -spot_dia 0.5 -spot_cutz -0.3 -spot_feedrate 100

drillcncjob test.DRL -mirror y -job_offset 10,0 -array 2,2 -array_pitch 50,40

drillcncjob test.DRL -objects test2.DRL,test3.DRL -area 0,0,50,30

drillcncjob test.DRL -drill_slots 1-overlap 20 -last_drill 1 -pdepth -0.02 -pfeed 75

milldrills

Class TclCommandMillDrills · Source tclCommands/TclCommandMillDrills.py

Creates a Geometry object that mills the drill holes of an Excellon object. The command waits until the Geometry object exists.

Aliases: milldrills, milld

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Excellon object.
milled_dias Option (-milled_dias) str no all Comma separated tool diameters to mill (example: 0.6,1.0). No spaces. The value all mills all tools.
tooldia Option (-tooldia) float no tools_mill_tooldia Diameter of the milling tool (example: 0.1). Must be positive.
outname Option (-outname) str no Name of the Excellon object with suffix _mill_drills Name of the Geometry object that holds the milled geometries.
use_thread Option (-use_thread) str no — Accepted for compatibility. The value is checked as a boolean and then ignored. The command always runs in its worker and waits.
diatol Option (-diatol) float no — (exact match of the diameter) Tolerance in percent (0.0 to 100.0). A diameter in -milled_dias matches a tool within this tolerance.

Examples:

milldrills mydrills -milled_dias "0.6,0.8" -tooldia 0.1 -diatol 10 -outname milled_holes
milld my_excellon.drl

millslots

Class TclCommandMillSlots · Source tclCommands/TclCommandMillSlots.py

Creates a Geometry object that mills the slots of an Excellon object. The command waits until the Geometry object exists.

Aliases: millslots, mills

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Excellon object.
milled_dias Option (-milled_dias) str no all Comma separated tool diameters of the slots to mill (example: 0.6,1.0). No spaces. The value all mills the slots of all tools.
tooldia Option (-tooldia) float no tools_mill_tooldia Diameter of the milling tool (example: 0.1). Must be positive.
outname Option (-outname) str no Name of the Excellon object with suffix _mill_slots Name of the object that holds the milled geometries.
use_thread Option (-use_thread) str no — Accepted for compatibility. The value is checked as a boolean and then ignored. The command always runs in its worker and waits.
diatol Option (-diatol) float no — (exact match of the diameter) Tolerance in percent (0.0 to 100.0). A diameter in -milled_dias matches a tool within this tolerance.

Examples:

millslots myslots -milled_dias "0.6,0.8" -tooldia 0.1 -diatol 10 -outname milled_slots
mills my_excellon.drl

write_gcode

Class TclCommandWriteGCode · Source tclCommands/TclCommandWriteGCode.py

Saves the G-code of a CNC Job object to a file. A relative file name is resolved against the folder from which FlatCAM started.

Aliases: write_gcode

Required arguments: name, filename

Argument Kind Type Required Default Description
name Positional str yes — Name of the source CNC Job object.
filename Positional str yes — Output file name and path.
preamble Option (-preamble) str no empty text G-code text added at the beginning.
postamble Option (-postamble) str no empty text G-code text added at the end.
muted Option (-muted) str (1/0) no False Hides errors in the Shell and status bar. 1 (True) or 0 (False).

Examples:

write_gcode name c:\\gcode_repo

export_gcode

Class TclCommandExportGcode · Source tclCommands/TclCommandExportGcode.py

Returns the G-code of a CNC Job object as text. Use the result in a Tcl variable. You can pass the result as preamble of another export_gcode or write_gcode call.

Aliases: export_gcode

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the source CNC Job object.
preamble Positional or Option (-preamble) str no empty text G-code text added at the beginning.
postamble Positional or Option (-postamble) str no empty text G-code text added at the end.

The command accepts no more than three positional values. Any further value gives an error.

Examples:

export_gcode geo_name -preamble "G01 X10 Y10" -postamble "G00 X20 Y20\nM04"

list_pp

Class TclCommandListPP · Source tclCommands/TclCommandListPP.py

Writes the names of the available preprocessors to the Tcl Shell. The command returns the names as a Tcl list.

Aliases: list_pp, listpp

Required arguments: None

This command has no arguments.

Examples:

list_pp
listpp

System and settings

open_folder

Class TclCommandOpenFolder · Source tclCommands/TclCommandOpenFolder.py

Opens a folder browser dialog. The command returns the path of the folder that the user selects.

Aliases: open_folder

Required arguments: None

Argument Kind Type Required Default Description
dir Option (-dir) str no — Folder that the dialog opens in first. If omitted, the dialog uses its default folder.

Examples:

open_folder

set_path

Class TclCommandSetPath · Source tclCommands/TclCommandSetPath.py

Sets the default folder for the Tcl Shell. Afterwards, files in that folder do not need the full path. The command also changes the Tcl working folder.

Aliases: set_path

Required arguments: path

Argument Kind Type Required Default Description
path Positional str yes — Folder path. Put quotes around a path that contains spaces. A relative path resolves against the folder where FlatCAM started. A file path fails.
create Option (-create) str no — True (1) or False (0). If True, the command creates the folder when it does not exist. If False, or omitted, a missing folder fails the command.

Examples:

set_path D:\Project_storage_path

get_path

Class TclCommandGetPath · Source tclCommands/TclCommandGetPath.py

Returns the default folder that the Tcl Shell uses for opening files. The command also writes a label to the shell output before it returns the folder.

Aliases: get_path

Required arguments: None

Argument Kind Type Required Default Description
— — — — — No arguments.

Examples:

get_path

get_sys

Class TclCommandGetSys · Source tclCommands/TclCommandGetSys.py

Returns the value of one system variable. The command fails if the name does not exist.

Aliases: get_sys, getsys

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the system variable. Use list_sys to find names.

Examples:

get_sys excellon_zeros

set_sys

Class TclCommandSetSys · Source tclCommands/TclCommandSetSys.py

Sets the value of one system variable in the running session. The command converts the value to the type of the current value. To keep the change, run save_sys.

Aliases: set_sys, setsys

Required arguments: name, value

Argument Kind Type Required Default Description
name Positional str yes — Name of the system variable. Use list_sys to find names. An unknown name fails the command.
value Positional str yes — New value. Boolean: True, False, 1, 0, yes, no, on, off. Number: a finite number. Units (units or names ending in _units): MM or IN. Zeros (names ending in _zeros, current value L or T): L or T. Empty value (None): none or a Python literal. List, tuple, or dict: a Python literal of the same type. Text: any text. An invalid value fails.

Examples:

set_sys global_gridx 1.0

list_sys

Class TclCommandListSys · Source tclCommands/TclCommandListSys.py

Returns the names of the system variables. Without an argument, the command returns all names. With a prefix, it returns only the names that start with that text.

Aliases: list_sys, listsys

Required arguments: None

Argument Kind Type Required Default Description
selection Positional str no — Optional name prefix. Only names that start with this text are listed. Main prefixes: gerber, excellon, geometry, cncjob, global.

Examples:

list_sys
list_sys ser
list_sys gerber
list_sys cncj

save_sys

Class TclCommandSaveSys · Source tclCommands/TclCommandSaveSys.py

Saves the current system variables to the defaults file. The command copies the session values to the defaults before it saves. It does the same as File > Save Defaults. The command runs in the background worker.

Aliases: save_sys, save

Required arguments: None

Argument Kind Type Required Default Description
timeout Option (-timeout) int no from preferences (global_background_timeout) Maximum wait in milliseconds, from 1 to 2147483647. Accepted by all background commands.

Examples:

save_sys

options

Class TclCommandOptions · Source tclCommands/TclCommandOptions.py

Returns the settings of one object as text. Each line has the form name: value. The command fails if the object does not exist. The command runs in the background worker.

Aliases: options

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the object.
timeout Option (-timeout) int no from preferences (global_background_timeout) Maximum wait in milliseconds, from 1 to 2147483647. Accepted by all background commands.

Examples:

options obj_name

version

Class TclCommandVersion · Source tclCommands/TclCommandVersion.py

Returns the program version as text.

Aliases: version

Required arguments: None

Argument Kind Type Required Default Description
— — — — — No arguments.

Examples:

version

quit_app

Class TclCommandQuit · Source tclCommands/TclCommandQuit.py

Quits the application from the Tcl Shell. The command calls the quit routine in silent mode.

Aliases: quit_app

Required arguments: None

Argument Kind Type Required Default Description
— — — — — No arguments.

Examples:

quit_app

clear

Class TclCommandClearShell · Source tclCommands/TclCommandClearShell.py

Clears the text in the Tcl Shell. The command also shows a status message in the application.

Aliases: clear

Required arguments: None

Argument Kind Type Required Default Description
— — — — — No arguments.

Examples:

clear

help

Class TclCommandHelp · Source tclCommands/TclCommandHelp.py

Shows the list of Tcl commands. With a command name, it shows the help for that command. An unknown name fails the command.

Aliases: help

Required arguments: None

Argument Kind Type Required Default Description
name Positional str no — Name of a Tcl command. Without it, the command lists all commands.

Examples:

help add_circle

Object access and misc

get_active

Class TclCommandGetActive · Source tclCommands/TclCommandGetActive.py

Returns the name of the active (selected) object. The command fails if no object is active.

Aliases: get_active

Required arguments: None

Argument Kind Type Required Default Description
— — — — — No arguments.

Examples:

get_active

set_active

Class TclCommandSetActive · Source tclCommands/TclCommandSetActive.py

Sets the object with the given name as the active (selected) object in the application. The command fails if it cannot set the object.

Aliases: set_active

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the object to set as active.

Examples:

set_active object_name

get_names

Class TclCommandGetNames · Source tclCommands/TclCommandGetNames.py

Returns the names of all objects in the project. The command returns one text value, with one name per line.

Aliases: get_names

Required arguments: None

Argument Kind Type Required Default Description
— — — — — No arguments.

Examples:

get_names

plot_all

Class TclCommandPlotAll · Source tclCommands/TclCommandPlotAll.py

Plots all objects in the application canvas. The command also sets the plot state of every object. In headless mode, nothing is plotted. The command shows a warning instead. The command runs in the background worker.

Aliases: plot_all

Required arguments: None

Argument Kind Type Required Default Description
plot_status Option (-plot_status) str no True True (1) or False (0). A bare -plot_status means True. If omitted, the value is True. Sets the plot state of every object to this value.
use_thread Option (-use_thread) str no — True (1) or False (0). A value is required. The command reads the value, but plotting always runs in the background worker. An invalid value fails the command.
timeout Option (-timeout) int no from preferences (global_background_timeout) Maximum wait in milliseconds, from 1 to 2147483647. Accepted by all background commands.

Examples:

plot_all
plot_all -plot_status False

plot_objects

Class TclCommandPlotObjects · Source tclCommands/TclCommandPlotObjects.py

Plots the named objects in the application canvas. The command also sets the plot state of each named object. Only Gerber, Excellon, Geometry, and CNCJob objects can be plotted. In headless mode, nothing is plotted. The command shows a warning instead.

Aliases: plot_objects

Required arguments: names

Argument Kind Type Required Default Description
names Positional str yes — Object names, separated by commas. Do not use spaces. Put quotes around the list if unsure. An unknown or unsupported object fails the command.
plot_status Option (-plot_status) str no True True (1) or False (0). A bare -plot_status means True. If omitted, the value is True. Sets the plot state of each named object to this value.

Examples:

plot_objects gerber_obj.GRB,excellon_obj.DRL

delete

Class TclCommandDelete · Source tclCommands/TclCommandDelete.py

Deletes one object. If no name is given, the command deletes all objects in the project.

Aliases: delete, del

Required arguments: None

Argument Kind Type Required Default Description
name Positional str no — Name of the object to delete. If omitted, the command selects all objects and deletes them.
f Option (-f) str no False Force deletion. A bare -f means True. True (1) or False (0). If omitted, the value is False. The value is passed as the force flag of the delete routine.

Examples:

del new_geo -f True
delete new_geo -f 1
del new_geo -f
del new_geo

bbox

Class TclCommandBbox · Source tclCommands/TclCommandBbox.py

Creates a rectangular Geometry object around a Gerber or Geometry object. The box uses the bounds of the object plus a margin. With rounded corners, the corner radius equals the margin.

Aliases: bounding_box, bbox

Required arguments: name

Argument Kind Type Required Default Description
name Positional str yes — Name of the Gerber or Geometry object.
outname Option (-outname) str no <name>_bbox Name of the new Geometry object.
margin Option (-margin) float no from preferences (gerber_bboxmargin) Distance from the object edges to the box edges, in mm.
rounded Option (-rounded) str no from preferences (gerber_bboxrounded) True (1) or False (0). True gives rounded corners with a radius equal to the margin. False gives square corners.

Examples:

bbox name -outname name_bbox

bounds

Class TclCommandBounds · Source tclCommands/TclCommandBounds.py

Returns the bounds of each named object. Each set of bounds is a list: [xmin, ymin, xmax, ymax]. The command returns one list for each object, in the order given. An unknown object fails the command.

Aliases: get_bounds, bounds

Required arguments: objects (the command code checks it; it is not in the required list)

Argument Kind Type Required Default Description
objects Positional str yes — Object names, separated by commas, with no spaces. The command fails if the list is empty.

Examples:

bounds a_obj.GTL,b_obj.DRL

Clone this wiki locally