2012

Table Of Contents
4 Add a blank line.
5 Save the file as ASCII text (TXT file), with a file extension of .scr.
The script file may contain comments, as follows:
; Turn grid on
grid on
; Set scale for linetypes
ltscale 3.0
; Set current layer and its color
layer set 0 color red 0
; Blank line above to end LAYER command
Run Scripts at Startup
A script that runs at startup can open a drawing and change its settings.
Suppose that every time you begin a new drawing, you turn on the grid, set
the global linetype scale to 3.0, and set layer 0 as your current layer, with red
as the color. You can do this using a drawing template, but you could do it
instead with the following script and store it in a text file called setup.scr.
grid on
ltscale 3.0
layer set 0 color red 0
The first line turns on the grid. The second line sets the global scale for
linetypes. The third line sets the current layer to layer 0 and sets its default
color to red. AutoCAD for Mac assumes that in a script you want to use the
version of LAYER command that displays command prompts rather than the
palette version. The result is equivalent to entering -layer at the command
prompt. The fourth line is blank, ending LAYER.
You could run a script at startup to open a drawing by using the following
syntax in a Terminal window:
AutoCAD drawing_name -b setup
All file names that contain embedded spaces must be enclosed in double
quotes, for example, “guest house”.
Including the file extensions .app, .dwg, .dwt, and .scr is optional. If AutoCAD
for Mac cannot find the script file, AutoCAD for Mac reports that it cannot
open the file.
Create Command Scripts | 75