Repository navigation
Script Object
A Script object holds a Tcl script. You write the script in the Script Editor, save it, and run it. The script can read and change the project with the Tcl commands. See Tcl Scripting.
- New Script command in the File menu: makes an empty Script object.
- Open Script command in the File menu: opens a script file as a Script object.
- Project tree: a Script row. The title of its Properties tab is Script Object.
- The Script Editor is shown in the Properties tab of the object. Its buttons are Open, Save and Run.
Screenshot placeholder:
images/Script-Object-1.png- the Properties tab of a Script object with the Name field, the Auto Completer check box and the Script Editor with its Open, Save and Run buttons.
- Choose File > New > Script. A Script row is added to the Project tree.
- Type the Tcl commands in the Script Editor.
- Click Save in the Script Editor. Choose a file name in the dialog. The default filter is
FlatCAM Scripts (*.FlatScript). - Click Run in the Script Editor. The script runs. If an error is found, the editor shows the line of the error.
| Parameter | Description | Default |
|---|---|---|
| Name (text box) | The object name in the project. Press Enter to apply. | Object name |
| Auto Completer (check box) | Turns on the auto completer in the Script Editor. The completer suggests the command names while you type. | On or off as saved in the project |
| Level (button) | Switches the object between Beginner and Advanced mode. | - |
The Plot check box is hidden. A Script object is not drawn on the canvas.
| Button | Description |
|---|---|
| Open | Opens a script file in the editor. It replaces the text in the editor. |
| Save | Saves the script. If the object has no file name yet, the save dialog opens. The default filter is FlatCAM Scripts (*.FlatScript). |
| Run | Runs the script with the application. The text in the editor is used. If the script has an error, the editor goes to the line of the error. |
The text area is the Script Editor. The text is the source of the object. Each change marks the project as changed.
Right-click a Script row in the Project tree. See Objects Overview. Copy, Delete and Rename are used the same way as for other objects.
- Run in the Script Editor and in the Tcl Shell: the Run button runs the script with the same engine as the Tcl Shell. See Tcl Shell.
- Command reference: each Tcl command is described in Tcl Command Reference.
- Saving a script with a project: the script text is kept in the project file. A saved script file is a separate file on the disk.
- Plot: the script object has no plot. A script does not add shapes to the canvas by itself. The commands it runs can add objects with plots.
- Auto completer: the check box and the editor use the list of names of the application. The names of the objects are also in the list.
FlatCAM Evo Manual · Source code · Report a problem · MIT license
Start here
- Installation
- Getting Started
- Tutorial: Single-Sided PCB
- Tutorial: Double-Sided PCB
- User Interface
- Keyboard Shortcuts
- Glossary
- FAQ and Troubleshooting
Files and projects
Objects
Editors
PCB operations
- Isolation Routing
- Non-Copper Clearing
- Paint
- Cutout
- Drilling
- Milling
- Follow
- Double-Sided
- Solder Paste
- Film
- Panelize
- Copper Thieving
- Fiducials
- Markers
- Punch Gerber
- Invert Gerber
- Etch Compensation
- Extract
- Rules Check
- QR Code
Utility plugins
- Align Objects
- Calculators
- Distance · Object Distance
- Optimal
- Move · Transform
- Subtract
- Image Import · PDF Import
- PCB Wizard
- Report
- Tcl Shell
Machine control (in development)
Advanced
- Tools Database
- Preprocessors
- Path Optimization
- Tcl Scripting
- Tcl Command Reference
- Developer Guide
- Translating
Preferences