Automating AutoCAD

October 2003

Over the last few weeks I have been fixing over 100 drawings for a customer and in so doing, have come across several features that I’d like to share with you all. If you do repetitive procedures, having a ‘button’ or tool to hit can be very efficient, especially if that tool combines several commands. This month I’ll introduce custom toolbar fundamentals and we’ll see where we go from there. We take a look at the semi-related feature of Profiles, as well as how to save some time when you launch AutoCAD and want to begin with your own template and newly-created Profile. Hopefully there will be a few insights here to take your AutoCAD ‘up a notch’.

You can contact Michael by email and be sure to visit his website, www.autocadtrainerguy.com for additional AutoCAD insights. If you have ideas about what you would like to see covered in 'Michael's Corner', he'd love to hear from you.


The Garden Variety Toolbar

acad.mnsWhere does my custom toolbar live?
When you create a toolbar from within AutoCAD, it is automatically saved to the acad.mns file, not in acad.mnu. Therefore, it is a REALLY good idea to backup all menu files (*.mn?) before creating your own toolbar.

Note to AutoCAD 2004 users only:
The acad.mns default location is (take a breath):
C:\Documents and Settings\Your Name\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Support.

 

Making a garden variety toolbar (this even works in LT!)

New Toolbar Dialogue1. Right-click on any AutoCAD tool and choose Customize to open the ‘Customize’ dialog box with four tabs: Commands, Toolbars, Properties, & Keyboard (+ Tool Palettes in A2004).

2. On the Toolbars tab, click New to open the ‘New Toolbar’ dialog box.

3. Enter a name for the toolbar and choose OK. (It’s best to leave it in the ACAD group). You will then see this very small toolbar with just one vertical bar in it.

Customize Dialogue4. To see a listing of the available tools, go to the ‘Commands’ tab. To see all the tools AutoCAD has to offer, scroll down in the Categories column and choose ‘All Commands’. For a description of a command, click on a command name in the Commands column.

5. To place a tool onto your toolbar, drag and drop the desired tool out of the Commands column onto your toolbar.

 

6. To delete a tool from your toolbar, right-click on it and choose Delete from the context menu. Another way to get rid of a tool from a toolbar is to drag and drop it into space.

7. After adding the desired tools, choose Close and AutoCAD does the rest!

Tip: To get a vertical bar between tools, drag one tool just a slight bit away from the other one.

Tip: To COPY one tool from an open toolbar, hold down the Ctrl key while you drag ‘n’ drop. However, this only works if the ‘Customize’ dialog box is open.


SNAPBASEThe Odd Spot

Hatch Base

Sometimes you need a hatch pattern to begin at a certain point. Other times, a line in the hatch is ‘too close’ to the profile of the shape or object being hatched and compromises the clarity. To specify the origin point of a hatch, use the SNAPBASE command. Although this command, as the name suggests, enables you to specify the origin of the increment snap (F9), it also specifies the hatch origin as indicated in the figure.

 

Free subscription to ‘The AutoCAD Toolbelt’ offer:
The first email to michael.beall@autocadtrainerguy.com telling me how many lines of code it takes to create a complex linetype and including an example (original or one of AutoCAD’s) will receive a complimentary one-year subscription (8 issues) of my newsletter, ‘The AutoCAD Toolbelt’.

STOP PRESS - Winner
The winner of this month's Toolbelt offer is Titus B. Ruch, CAD/CAM Manager at FFE Minerals USA Inc. - well done! And the answer is, each linetype requires two lines of code: One for the definition and one for the code itself identifying pen up/pen down and text or shape information. All of this can be found in the acad.lin file under ...\Support.


Power Tool

‘Auto-Launch’ AutoCAD

The Windows Start button enables you to select the programs you wish to launch, but there is a faster way to do it.

To setup a shortcut key to launch AutoCAD, do this:

1. Right-click on the Desktop AutoCAD icon and choose ‘Properties’ from the context menu.

2. Click in the Shortcut key area, then enter the letter you would like to use to launch AutoCAD. In the example, you see that AutoCAD 2004 will launch with a combination of Ctrl + Alt + 4. If you want to change it, backspace and put in a different one.

Tip: You can assign a ‘Shortcut key’ to ANY application icon on your Desktop. You may want to consider Ctrl+Alt+W to launch Word, X for Excel, P for PowerPoint, … and F for Freecell!

Properties Dialogue

There are two other useful settings called ‘switches’ that you can add to the launching of AutoCAD.

/t   Notice the lower case ‘t’. After the forward slash ‘switch’, type the name of the template file you want AutoCAD to use when launched. If the template name contains a space, put the name in quotes.

/p   Notice the lower case ‘p’. Type the Profile name AutoCAD is to use on startup. For best results, put the profile name in quotes.

To automate the folder in which AutoCAD ‘looks’ when you Open or Save, enter the path and folder name in the Start in: field (in quotes).

Tip: The REMEMBERFOLDERS variable must be set to <0> for the “Start in” folder to be enabled.


The Basics: Profiles for Performance

ProfilesThe key to working with profiles is to remember that AutoCAD is 'recording' all the changes you make to the current profile ... so think before you make the changes.

1. To create a named profile, from the Profiles tab of the Options dialog click Add to List, then enter a name for your profile (Dash/Underscore are OK; no periods, etc.).

Choose Apply & Close and you will see the name in the list ... but it's not current.


2. Double-click on the name (or choose Set Current) then configure AutoCAD the way to you want it (Cursor size, Color, Background, Command line position and size, Toolbars and position). Since AutoCAD is ‘recording’ all changes to the current profile, you’re ready to go!


3. Export each of your profiles using the Export button.

Back it Up
Since there is always a possibility that you may mistakenly modify this profile, the next thing you should do is make one that you will use as your ‘working’ profile. This will allow you to retain the integrity of the original if something happens.

Tip: If you're going to make a change to the toolbar or screen settings, confirm which profile is current before you do so.