Sunday, September 5, 2010
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now
<< < > >>

Customization Corner - May 2004

Last month, I finished the second installment of using and creating scripts for use with AutoCAD and AutoCAD LT. Here, I’ll turn the attention from customizing inside of AutoCAD and AutoCAD LT to the desktop shortcut. There are many options to get AutoCAD or AutoCAD LT start up. You have seen one of these options or switches in the previous articles about scripts. That switch was the /b switch, which allowed for the loading of a script when the desktop shortcut was used. This article investigates the many other switches available to you.

What Is a Switch?

A switch can be summed up as a way to supply additional instructions to an application, like AutoCAD, at startup. A switch is also referred to as command line switch, which describes what’s really happening in the background when you use a shortcut like the AutoCAD 2005 desktop icon. The number and type of switches have changed over the years as new features have been added to AutoCAD. Switches have been around since at least AutoCAD R13 when Autodesk created it as a true Windows-based application. There are other Windows applications, such as MS Excel and MS Word, that can use switches with their desktop shortcuts as well.

How to Modify a Shortcut to Use a Switch

The main thing that you should do before ever making modifications to anything the first time is to create a backup copy of the file that is to be modified. In this case name doesn’t matter when creating a desktop shortcut, like it does when making changes to the ACAD.PGP, (or ACLT.PGP if you are using AutoCAD LT), or some other customizable files in the AutoCAD environment.

To make a copy and modify the shortcut for AutoCAD, follow the steps below.

  1. Locate the AutoCAD 2004/5 icon on the desktop.
  2. Left-click to select the shortcut.
  3. Right-click and select Copy from the shortcut menu.
  4. Right-click again on the desktop and select Paste from the shortcut menu.
  5. Left-click on the new shortcut, then right-click on the shortcut and select Properties from the shortcut menu.
  6. In the Properties dialog box, select the Shortcut tab.
  7. On the Shortcut tab, you will need to edit the value in the Target box.
  8. When making changes to the Target text box, make sure you don’t accidentally remove any section of the application path or filename itself. You will also want to make sure there is a single space after the path and file name or other value before the switch. Also, make sure there is a space between each argument of your switch statements.
  9. Move the cursor all the way to the right in the Target text box. It should be after the value “C:\Program Files\AutoCAD 2005\acad.exe” or after any switches that might be present already. Add the switch and value and click the Ok button. You can also switch to back to the General tab in the Properties dialog box to give the new shortcut a different name.

A Look at Available Switches

Using No Switches
If you don’t use any switches at all AutoCAD will launch normally. You can, however, add a drawing path and name that you would like to have opened when AutoCAD starts. More than one drawing can be used—just make sure to add a space between files. If the file or path has spaces in it you will need to place double quotes around the path and name as shown below. I find it easiest to use double quotes all the time when working with switches.

“C:\Program Files\AutoCAD 2005\acad.exe” “c:\base.dwg” “c:\electrical plan.dwg”

/b Switch
The /b switch allows you to start AutoCAD and then run a Script file right away. This is a great way to set up some items that are drawing and not drawing-based such as Object Snaps or some other user preferences. See the March and April AUGI HotNews issues for more on Script files. If the file or path has spaces in it, you will need to place double quotes around the path and name as shown below.

“C:\Program Files\AutoCAD 2005\acad.exe” /b “c:\tools\startup.scr”

/ld Switch (new in AutoCAD 2005; not found in AutoCAD LT)
The /ld switch allows you to start AutoCAD and load either an ObjectARX or ObjectDBX file. It might be a great way to load a third-party application that is written as an ObjectARX application. If the file or path has spaces, be sure to use double quotes around the path and name.

“C:\Program Files\AutoCAD 2005\acad.exe” /ld “c:\tools\coretools.arx”

/nologo Switch
The /nologo switch allows you to start AutoCAD and the splash screen is not displayed.

“C:\Program Files\AutoCAD 2005\acad.exe” /nologo

/nossm Switch (new in AutoCAD 2005; not found in AutoCAD LT)
The /nossm switch allows you to start AutoCAD and if the Sheet Set Manager was loaded the last time that AutoCAD was closed, it will not be displayed on screen.

“C:\Program Files\AutoCAD 2005\acad.exe” /nossm

/p Switch (not found in AutoCAD LT)
The /p switch allows you to start AutoCAD with the specified profile name. You can specify either a profile name or an exported profile that is in the form of an ARG file. If you use multiple profiles in AutoCAD, this is a great way to make sure that you are loading the correct profile. If the file or path has spaces, be sure to use double quotes around the path and name.

“C:\Program Files\AutoCAD 2005\acad.exe” /p “Structural”
“C:\Program Files\AutoCAD 2005\acad.exe” /p “c:\tools\profile\my profile.arg”

/set Switch (new in AutoCAD 2005; not found in AutoCAD LT)
The /set switch allows you to start AutoCAD and load a specific Sheet Set. Both the path and name need to be specified for the DST file. If the file or path has spaces, be sure to use double quotes around the path and name.

“C:\Program Files\AutoCAD 2005\acad.exe” /set “c:\drawings\sheetsets\project1.dst”

/t Switch
The /t switch allows you to start AutoCAD with the specified drawing template file. This will create a new drawing called Drawing1.dwg based on the template name. Using this switch will also by-pass the traditional startup dialog box. If the path is not specified, AutoCAD will search the support paths and the template location for the DWT file. If the file or path has spaces, be sure to use double quotes around the path and name.

“C:\Program Files\AutoCAD 2005\acad.exe” /t “bsize.dwt”
“C:\Program Files\AutoCAD 2005\acad.exe” /t “c:\drawings\templates\bsize.dwt”

As you can see, there are a variety of switches that you can use with your desktop shortcut. One other thing to note is that more than one switch can be used at a time. Below is an example that shows the use of the /t and /p switches. This can be a great way to make sure the correct template and profile are used.

“C:\Program Files\AutoCAD 2005\acad.exe” /t “mainplan.dwt” /p “Mechanical”

If you want more information on command line switches, you can do a search on the Internet or take a look in the AutoCAD Help files. If you are looking in the AutoCAD Help files, you will find the command line switches under the topic User’s Guide>>The User Interface>> Customize the Drawing Environment>>Customize Startup.

And Others

I have covered many of the popular switches, but here are some more that are less frequently used.

/automation – used with programming automation
/c – used to point to a different configuration file
/layout – loads a layout with the specified drawing
/pl – prints off the drawings listed in a DSD file created with Publish
/r – resets the configuration file
/s – add additional support paths
/v – loads the specified drawing with the named view

In the next issue, I will cover Tool Palettes, which have become very popular since their introduction in AutoCAD 2004.

Submitted by Lee Ambrosius of HyperPics.


<< < > >>