NOTEVBA and AutoLISP® scripts that run at startup should check for whether the
AutoCAD LT process is visible or invisible. If the process is invisible, the script should
not execute, because the process may be performing background plotting or
publishing operations. To check for whether the AutoCAD LT process is visible or
invisible, you can use the Visible property of the Application object in the AutoCAD
LT Object Model.
You could run a script at startup to open a drawing by using the following
syntax in the Run dialog box:
ACADLTdrawing_name/bsetup
All file names that contain embedded spaces must be enclosed in double
quotes, for example, “guesthouse”. You can also specify the view that is
displayed when the drawing opens by using the /v switch and the view name.
The /b switch and the script file must be the last parameter listed.
Including the file extensions .exe, .dwg, .dwt, and .scr is optional. If AutoCAD
LT cannot find the script file, AutoCAD LT reports that it cannot open the
file.
To run the same script at startup but create a new drawing using the
MyTemplate.dwt file as the template, enter the following in the Run dialog box:
ACADLT/t MyTemplate/b setup
This command creates a new drawing and issues a sequence of setup commands
from the setup.scr file. When the script has finished running, the command
prompt is displayed. If you want to use the default template for the new
drawing, you can omit the /t switch and the template file name.
NOTEYou can no longer use this method to start a new drawing and give it a
name. Name the drawing when you save it.
To run a script at startup
1 Click Start menu (Windows) ➤ Run.
2 In the Run dialog box, enter acadlt drawing_name /b script_name.
To start a new file, instead of a drawing file name, enter the /t switch and
the name of a template file: /t template_drawing.
To open a drawing file to a particular view, follow the drawing name
with the /v switch and the name of the view: /v view_name.
The name of the script file must be the last parameter listed. The file
extensions are optional.
Run Scripts at Startup | 353