AutoCAD LT can read and execute a sequence of commands from a text file called a script. Writing a script is an easy-to-use method for creating continuously running displays for product demonstrations and trade shows.
Scripts can execute any command at the Command prompt except commands that display dialog boxes. AutoCAD LT provides command line versions of the dialog box commands.
Table: Script Access to Dialog Box Commands
The following commands are useful in scripts:
You create script files outside AutoCAD LT using a text editor (such as Windows Notepad) or a word processor (such as Word) that can save the file in ASCII format. The file extension must be .scr. You must be very familiar with the sequence of AutoCAD LT prompts to provide an appropriate sequence of responses in the script file.
Example: A Script that Changes Settings in a Drawing
Each blank space in a script file is significant: AutoCAD LT accepts either a space or ENTER as a command or data field terminator. Script files can contain comments. Any line that begins with a semicolon (;) is considered a comment, and AutoCAD LT ignores it while processing the script file.
When command input comes from a script, AutoCAD LT assumes that the settings of the PICKADD and PICKAUTO system variables are 1 and 0, respectively; therefore, you do not have to check the settings of these variables.
AutoCAD LT considers a script to be a group, a unit of commands, reversible by a single U command. However, each command in the script causes an entry in the undo log, which can slow script processing. If you like, you can use UNDO Control None to turn off the undo feature before running the script, or you can write it at the beginning of the script itself. Remember to turn it back on (UNDO Control All) when the script is finished.
The script that is running stops when another script command is invoked.
Note: Keep in mind that AutoCAD LT prompts and command names may change in future releases, so you may need to revise your scripts when you upgrade to a later version of AutoCAD LT. For similar reasons, avoid the use of abbreviations; future command additions might create ambiguities.
To invoke a script when you start AutoCAD LT, use the following command form:
aclt [existing_drawing or /t template_drawing] [/v view] [/b script_file]
The script file must be the last parameter listed. Including the file extensions .exe, .dwg, .dwt, and .scr is optional.