9.5. The Blade Runner Script Editor
Blade Runner is IQcad’s built-in editor for Python and Pascal scripts. It runs inside IQcad against the open drawing, so a script can be written, run, corrected and re-run without leaving the application or reloading anything.
Open it with the BLADE command (alias BLADERUNNER). The window is
non-modal: leave it open beside the drawing while you work.
The languages themselves are documented in Python Scripting Reference and Pascal Scripting; this chapter covers the editor.
9.5.1. Buffers and Files
Open scripts appear as tabs across the top of the editor. Each tab keeps its own caret position, scroll offset, undo history and language; switching tabs swaps the editor content.
Action |
Shortcut |
Notes |
|---|---|---|
New Python |
Ctrl+N |
Opens an empty buffer with Python syntax highlighting. |
New Pascal |
— |
The same for Pascal. |
Open… |
Ctrl+O |
The language follows the file extension: |
Open Recent |
— |
The ten most recently opened scripts, kept across sessions. |
Save |
Ctrl+S |
|
Save As… |
Ctrl+Shift+S |
|
Close |
Ctrl+W |
Closes the current tab; you are asked about unsaved changes. |
9.5.2. Running a Script
Action |
Shortcut |
Notes |
|---|---|---|
Run |
F5 |
Runs the whole buffer against the active drawing. |
Run Selection |
Shift+F5 |
Runs only the highlighted text — the fastest way to try one call without splitting the file. |
Output appears in the pane below the editor: everything the script prints
(iqcad.write_line and its Pascal equivalent) is tee’d there as well as
to IQcad’s command line, so nothing is lost if the editor is closed. Runtime
errors are reported in the same pane with their message and, where the host
provides it, the line number.
Esc interrupts a long-running script — see Responsiveness and Esc in the scripting chapters.
Toggle the output pane from View › Output; drag the splitter to resize it.
9.5.5. The Command Palette
F1 opens a command palette over the editor. Type any part of a command
name — the match is fuzzy, so rsel finds Run Selection — and press
Enter to run the top hit. Every editor action is reachable this way, with
its shortcut shown beside it.
9.5.6. Appearance
View › Theme switches between the dark theme (the default, a VS-Code-style palette) and a light one. The choice applies to the editor, both syntax highlighters and the surrounding panels, and is remembered.
Window position and size, the output-pane height, the sidebar state and the
theme are all stored in IQcad’s settings.json — see
Application Settings.