Script files are like macros that you create in your word processor or spreadsheet. They automatically execute a series of commands. You can use script files to automate plotting, set up a drawing, clean up a drawing, create a slide show, or do any repetitive task. By running a script file on a number of drawings, you can complete a time-consuming task in a fraction of the time.
You can also record actions on the screen and save them as a macro. Doing so saves you the time of figuring out the exact command-line sequences.
If you need to put together just a few commands that you might use another time for other drawings, you may want to consider creating a menu item or toolbar button instead. Chapter 29 explains how to customize toolbars, and Chapter 33 explains how to customize the ribbon and menus.
A script file contains a list of commands and options. To create a script file, you need to think out the commands that you want to execute, as well as their options and prompts. Then you create the text for the script file. Script files have the following characteristics:
They must use the
.scr filename extension.
They are text-only (ASCII) files.
They must use command-line syntax only (which can include AutoLISP expressions if you are creating a script for AutoCAD only and not AutoCAD ...