03.01.2013 Views

Customization Guide (.pdf) - Documentation & Online Help - Autodesk

Customization Guide (.pdf) - Documentation & Online Help - Autodesk

Customization Guide (.pdf) - Documentation & Online Help - Autodesk

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NOTE VBA and AutoLISP ® scripts that run at startup should check for whether the<br />

AutoCAD LT process is visible or invisible. If the process is invisible, the script should<br />

not execute, because the process may be performing background plotting or<br />

publishing operations. To check for whether the AutoCAD LT process is visible or<br />

invisible, you can use the Visible property of the Application object in the AutoCAD<br />

LT Object Model.<br />

You could run a script at startup to open a drawing by using the following<br />

syntax in the Run dialog box:<br />

ACADLT drawing_name /b setup<br />

All file names that contain embedded spaces must be enclosed in double<br />

quotes, for example, “guest house”. You can also specify the view that is<br />

displayed when the drawing opens by using the /v switch and the view name.<br />

The /b switch and the script file must be the last parameter listed.<br />

Including the file extensions .exe, .dwg, .dwt, and .scr is optional. If AutoCAD<br />

LT cannot find the script file, AutoCAD LT reports that it cannot open the<br />

file.<br />

To run the same script at startup but create a new drawing using the<br />

MyTemplate.dwt file as the template, enter the following in the Run dialog box:<br />

ACADLT /t MyTemplate /b setup<br />

This command creates a new drawing and issues a sequence of setup commands<br />

from the setup.scr file. When the script has finished running, the command<br />

prompt is displayed. If you want to use the default template for the new<br />

drawing, you can omit the /t switch and the template file name.<br />

NOTE You can no longer use this method to start a new drawing and give it a<br />

name. Name the drawing when you save it.<br />

To run a script at startup<br />

1 Click Start menu (Windows) ➤ Run.<br />

2 In the Run dialog box, enter acadlt drawing_name /b script_name.<br />

To start a new file, instead of a drawing file name, enter the /t switch and<br />

the name of a template file: /t template_drawing.<br />

To open a drawing file to a particular view, follow the drawing name<br />

with the /v switch and the name of the view: /v view_name.<br />

The name of the script file must be the last parameter listed. The file<br />

extensions are optional.<br />

Run Scripts at Startup | 353

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!