How to Record and Play Actions in BricsCAD
Quick answer: BricsCAD can record a sequence of commands to a .scr script file and play it back later. Recording uses RECSCRIPT and STOPSCRIPT; playback uses SCRIPT. Since scripts are plain text, you can also hand-edit them directly, even though BricsCAD has no built-in script editor.
Recording a Script
- In a new drawing, run
RECSCRIPT, or choose Record Script… from the Tools menu. The Record Script dialog opens. - Enter a filename and click Save; this creates a
.scrfile (for example,border.scr). - The dialog closes and the Command line becomes active. Enter commands as you normally would; everything you type or click gets recorded, including mouse-picked points, which are saved as x,y coordinates.
- Run
STOPSCRIPTwhenever you want to stop recording.
Playing Back a Script
- Start a new drawing with
NEW, so you can clearly see the script’s effect. - Run
SCRIPT. The Run Script dialog opens. - Choose your
.scrfile and click Open. The recorded actions run automatically.
Editing a Script by Hand
BricsCAD has no dedicated command for editing scripts, only recording and running them. To change one, open the .scr file in a plain text editor (Notepad on Windows, TextEdit on macOS or Linux) and edit it directly.
A couple of things worth knowing:
- Coordinates and values appear exactly as you entered them during recording; editing a rectangle’s size, for example, just means changing the numbers directly in the file.
- Adding a new command sequence, like placing your rectangle on a specific layer, means writing the command and its options on their own lines, followed by blank lines wherever you’d normally press Enter to confirm. Missing a blank line where one’s needed will break the sequence.
The Four Script Commands
| Command | What it does |
|---|---|
SCRIPT |
Loads a script file and immediately starts running it. Set FILEDIA to 0 first, otherwise a dialog box interrupts the process instead of prompting at the Command line |
RSCRIPT |
Reruns whichever script is currently loaded, useful for creating an infinite loop |
RESUME |
Resumes a script that’s been paused with the Backspace key |
DELAY |
Pauses a script for a set number of milliseconds without needing anyone to intervene; minimum 1 millisecond, maximum 32767 (just under 33 seconds); useful for timing slide displays or slowing a script down enough for someone to actually watch it run |
All four are transparent, meaning they can run in the middle of another active command, not just on their own. To run a script transparently, prefix SCRIPT with an apostrophe.
Special Characters in Scripts
| Character or key | What it does |
|---|---|
| Space or a blank line (Enter) | Both are equivalent to pressing Space or Enter, and are interchangeable. Since they’re invisible in a text file, it’s easier to write one command or value per line rather than counting inline spaces |
; (semicolon) |
Marks a comment; everything after it on that line is ignored |
' (apostrophe) |
Runs a script command transparently, during another active command |
| Backspace | Pauses a running script |
| Esc | Stops a script completely; use RSCRIPT to restart it from the beginning, RESUME won’t work after a full stop |
Frequently Asked Questions
Can I edit a recorded script directly, or do I have to re-record it? You can edit it directly in a plain text editor. BricsCAD doesn’t have a built-in script editor, but the .scr file itself is just plain text.
Why does running SCRIPT sometimes open a dialog box instead of just running? Check the FILEDIA system variable. Set it to 0 so prompts appear at the Command line instead of triggering a dialog.
How do I create a delay in a script without needing someone to press a key? Use the DELAY command with a value in milliseconds, from 1 up to 32767 (just under 33 seconds).
What’s the difference between stopping a script with Esc and pausing it with Backspace? Backspace pauses it, and RESUME picks up where it left off. Esc stops it completely, and only RSCRIPT can start it again, from the very beginning.