Stratal CAD

Running a command script

Help centre · Getting started

A command script (.scr file) runs a list of commands and answers in the drawing as if you typed them. Use scripts to repeat set-up steps, such as making layers or drawing a standard border.

Before you start

Steps

  1. Write the script in a text editor. Each entry is what you would type at the command line.
  2. In Stratal CAD, choose File > Run Script… and pick the file. Or type SCRIPT (alias SCR) and, at "Enter script file name (.scr)", type its name.
  3. The command line says "Running script name.scr (n entries)." and runs each entry. Each command is its own undo step.

How a script is read

In the file Means
A space or a line end Ends an entry (like pressing Enter)
Two spaces or line ends in a row, or an empty line An Enter of its own, which at the command prompt repeats the last command
Text in double quotes One entry with its spaces, for example -LAYER M "Board room"
A line starting with ; A comment, ignored

Example

A script that makes two layers and draws an A3 frame at 1:1 in mm:

; set-up.scr
-LAYER M Frame C 7 Frame

-LAYER M "Title block" C 3 "Title block"

-LAYER S Frame

RECTANG 0,0 420,297

Tips and common mistakes

Troubleshooting

Message or symptom What it means and what to do
"The script ... could not be opened." The file is not there or cannot be read. Check the name and folder.
"Scripts started each other more than 8 deep; this one was not run." Scripts call each other too deeply, possibly in a loop. Check which script runs which.
"Invalid input (...)" in the middle of a script An entry did not fit the prompt. Check the order of answers against the command's prompts.

Related

Related

Still stuck? Open a support ticket or use Help, then Contact support in Stratal CAD.