Professional Documents
Culture Documents
Top Autocad Customization Tips
Top Autocad Customization Tips
Top
Customization Tips Every
AutoCAD User Should Know
By Ellen Finkelstein
www.ellenfinkelstein.com
1
Top AutoCAD Customization Tips
Limit of liability/disclaimer of warranty: the publisher and the author make no Representations or warranties with
respect to the accuracy or completeness of the Contents of this work and specifically disclaim all warranties, including
without Limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or
promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work
is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an
organization or website is referred to in this work as a citation and/or a potential source of further information does
not mean that the author or the publisher endorses the information the organization or website may provide or
recommendations it may make. Further, readers should be aware that Internet websites listed in this work may have
changed or disappeared between the time this work was written and when it is read.
For general information on our other products and services, please go to www.ellenfinkelstein.com. This book is published in
both electronic and print format.
2
Top AutoCAD Customization Tips
3
Top AutoCAD Customization Tips
***
To MMY, for teaching me that the Unified Field and the spirit of God
are one and the same, and that anyone can experience it as bliss
consciousness.
***
4
Top AutoCAD Customization Tips
Introduction
AutoCAD users are always looking for ways to be more productive.
That’s why they love tips! AutoCAD is meant to be customized, but
customization is one of the most complex features of AutoCAD. I’ve
been writing tips for years, so I thought I would compile some favorite
customization tips so everyone can easily use them.
One reason that I love writing AutoCAD tips is that people are so
appreciative. They really want to learn more about this huge program.
AutoCAD is not only useful – it’s fun! I hope that this e-book will help
you become more productive, less stressed, and more knowledgeable.
5
Top AutoCAD Customization Tips
Contents
About the Author 3
Introduction 5
Chapter 1 Automation 7
1. Create a command alias (keyboard shortcut) 7
2. Automate tasks with a script file 12
3. Record macros with the Action Recorder 14
4. Use the command line to launch programs 22
5. Create a custom command 22
6. Create a custom keyboard shortcut 26
Chapter 4 AutoLISP 50
12. Get all of your AutoLISP routines to load themselves 50
13. Create a custom command for AutoCAD using AutoLISP 51
Chapter 5 Miscellaneous 56
14. Create a custom function in AutoCAD’s calculator 56
15. Easily share tool palettes with colleagues 61
6
Top AutoCAD Customization Tips
Chapter 1
Automation
One of the main reasons for customizing AutoCAD is to speed up your
work. In this section, I cover
Command aliases
Script files
Recording macros
Launching programs from the command line
Custom commands
Keyboard shortcuts
The acad.pgp file is a text file and you can edit it directly, but the
easiest way is to use the Express Tools ALIASEDIT command.
7
Top AutoCAD Customization Tips
8
Top AutoCAD Customization Tips
9
Top AutoCAD Customization Tips
Tip: To print the alias list, choose File > Print from
the AutoCAD Alias Editor’s menu.
10
Top AutoCAD Customization Tips
11. Check the PGP File check box and click OK. Now
your new aliases will work. Try them out!
Note: You can edit the acad.pgp file directly. It’s in the Support
folder. To find that folder, choose Tools > Options and click the Files
tab. Double-click the Support File Search Path item and look at the
first item. This file contains a User Defined Command Aliases section
at the end where you can add your own aliases; these aliases override
those in the main section. Use the same format as you see in the file,
11
Top AutoCAD Customization Tips
12
Top AutoCAD Customization Tips
To run and test the script file from within a drawing, use the
SCRIPT command. A dialog box opens, where you can choose
your script file. Click Open and the script runs.
Let’s say that you want to run a script file on more than one
drawing. You can use the OPEN, CLOSE, and QSAVE commands to
open drawings, run some commands, save the drawings, and then
close them. You can still start the script from within the 1st drawing,
but you can also start a script file as you open AutoCAD.
13
Top AutoCAD Customization Tips
/b script_name
4. Click OK.
14
Top AutoCAD Customization Tips
Start by thinking about the conditions that you’ll need when you
run the macro. Will you be in model space or paper space? The macro
doesn’t keep track of all of the current settings. If a certain setting is
necessary, use the system variable or the SETVAR command while
recording the macro to make sure that you have the setup you’ll need
at playback time.
15
Top AutoCAD Customization Tips
16
Top AutoCAD Customization Tips
the macro, since I didn’t know which way the display would be when I
played back the macro. If I wanted to turn the display on, and it was
already on, clicking the button would turn it off! So I needed to find
the system variable involved, which was LWDEFAULT. Then, it was
easy to turn it on and off as needed.
When you’ve figured out the steps that you want to take, and
tried them out a couple of times in different situations, you’re ready
to record.
17
Top AutoCAD Customization Tips
18
Top AutoCAD Customization Tips
Here’s what the macro looks like in the Action Recorder drop-
down window:
19
Top AutoCAD Customization Tips
20
Top AutoCAD Customization Tips
21
Top AutoCAD Customization Tips
To edit this file and add more commands, choose Tools >
Customize > Edit Program Parameters. Notepad opens the acad.pgp
file. Scroll down until you see the following:
If you add commands, use the same format. The text before
these commands explains the meaning of the 1 and the general
format. Then save the file. Back in AutoCAD, type reinit to reinitialize
acad.pgp and you’ll be able to use your changes.
22
Top AutoCAD Customization Tips
If you think your command will be long or need more than one
line, click in the Macro text box and then click the Ellipsis button that
appears on the right. Then enter your macro in the Long String Editor
dialog box. Otherwise, enter the macro in the Macro text box. Start by
writing out the combination of commands and options as you would
enter them on the command line or in a script. Then add any
necessary special characters.
Below are the special characters you need to know for menu
macros:
Character Description
23
Top AutoCAD Customization Tips
24
Top AutoCAD Customization Tips
You can use the Button Editor to give it an image. Usually, you
choose an existing button to start with, click Edit, and modify it. Then
click the Save As button to save the icon image.
25
Top AutoCAD Customization Tips
In the Properties pane, you can now specify your new command.
Enter a name and a macro. If the macro is long, click the Ellipsis
button at the right side of the Macro text box to open the Long String
Editor. My macro was^C^C_select;\_copy;_previous;;\\;;
26
Top AutoCAD Customization Tips
Find your new command in the Command List pane (it’s listed
under the name you gave it and a tip is to choose Custom Commands
from the drop-down list in that pane) and drag it to the Shortcut Keys
item in the top pane.
27
Top AutoCAD Customization Tips
Press the shortcut key combination you want to use and you can
see if it’s unassigned — or assigned to something you never use.
Generally, it has to start with Ctrl, Ctrl+Shift, or Shift. Click OK.
28
Top AutoCAD Customization Tips
Chapter 2
User Interface
AutoCAD's user interface is completely customizable and you should
certainly take advantage of this fact to organize the ribbon to make
your work go more quickly and make the user interface look the way
you want it to.
Tip: If you display the tab you want to work on and type cui on
the command line, you can see that tab as you work– just move the
Customize User Interface dialog box. In fact, if you click the title of
the panel you want to work on and click the Pin icon, you can keep
even the bottom section open as you work. (Unfortunately, the
bottom section collapses when you click Apply.)
29
Top AutoCAD Customization Tips
Expand the panel where you want to add your command. You’ll
see several rows. Expand one or more rows that you might want to
look at. Here you see the Draw-2D panel open with several of its
rows. To the left, you can see the expanded panel itself.
30
Top AutoCAD Customization Tips
31
Top AutoCAD Customization Tips
When you’ve made a few changes and want to see how they
look, click the Apply button and wait while AutoCAD reloads the menu.
When you’re done, click OK. Here you can see my new menu.
I’ve added a custom 1LINE command (line \\;) which ends the LINE
command after one line. I’ve also moved the existing buttons around
and banished some to below the panel separator.
32
Top AutoCAD Customization Tips
33
Top AutoCAD Customization Tips
34
Top AutoCAD Customization Tips
On the other hand, if you think that the command line takes up
too much space you can hide it or collapse it.
Check the Always Close the Command Line Window check box
to avoid seeing this message the next time. Then click Yes. Now, you
can easily toggle the command line to display and hide it.
35
Top AutoCAD Customization Tips
Then right-click the gray title bar and choose Auto-Hide. The
command line palette collapses to a small gray bar. That’s pretty
small! But as soon as you hover your cursor over the bar, the
command line expands.
commands starting with the letters you typed and you can choose the
desired command.
You can also use Ctrl+V to paste text from the Windows
clipboard.
Here are some more ways to make using the command line
easier:
Repeat the last line you entered: Press the Up arrow
and press Enter.
37
Top AutoCAD Customization Tips
38
Top AutoCAD Customization Tips
interface I know of. The most common item to change here is the
drawing background, but you’ll find a lot more options here.
Click the Color drop-down list and choose a color. You can
choose a standard color or click Select Color to specify any color you
want.
39
Top AutoCAD Customization Tips
40
Top AutoCAD Customization Tips
Chapter 3
Linetypes and hatches
Choose File > Save As and save it under another name, but in
the same folder, such as mylinetypes.lin. You can edit acad.lin
directly, but be sure to back it up first.
41
Top AutoCAD Customization Tips
A linetype has two lines of text. The first line’s syntax looks like
this:
42
Top AutoCAD Customization Tips
That means that the first line always starts with an asterisk (*).
Then you add the name, which can’t have spaces. The description is
optional and limited to 47 characters. If you add a description,
precede it with a comma. For example:
The second line, which defines the linetype, starts with the letter
A. You separate each item with a comma, but no spaces. The
maximum length for the second line is 80 characters. Here are your
options:
Press Enter after the second line and save the file. Here’s an
example:
43
Top AutoCAD Customization Tips
Click the New Layer icon and name the new layer anything you
want. Assign it any color you want.
44
Top AutoCAD Customization Tips
If you create your own .pat file, here are some points to
remember:
If you aren’t adding patterns to acad.pat or acadlt.pat,
you can put only one hatch pattern in a custom .pat file;
the filename and pattern name must be the same
You can insert comments in your .pat file after a
semicolon
You must press Enter after the end of the last line of the
hatch definition
*pattern-name[, description]
45
Top AutoCAD Customization Tips
You can have more than one definition line (the second
line in the syntax I just showed), creating sets of hatch
definitions that combine to create the hatch pattern.
46
Top AutoCAD Customization Tips
47
Top AutoCAD Customization Tips
This hatch pattern has 4 lines. Two are at 0 degrees, and two
are at 90 degrees. This creates the rectangular shape. The difference
between the two lines that start at 0 degrees is their origin. The
second one starts at 0,1.5. The 90-degree lines also have different
origins. The linetype for the 90-degree lines is dash, space, dot,
space, dash, space.
48
Top AutoCAD Customization Tips
49
Top AutoCAD Customization Tips
Chapter 4
AutoLISP
AutoLISP was the original programming language that allowed you to
program AutoCAD and it's still widely used, even though there are
other options. In this chapter, I explain how to:
50
Top AutoCAD Customization Tips
Open Notepad.
Save the file in a folder that is in your support file search path.
Name it redcircle.lsp (not .txt, the default for Notepad).
51
Top AutoCAD Customization Tips
In AutoCAD, choose
Manage tab> Applications
panel> Load Application (the
APPLOAD command) to open
the Load/Unload Applications
dialog box.
Click Close.
52
Top AutoCAD Customization Tips
53
Top AutoCAD Customization Tips
54
Top AutoCAD Customization Tips
): This closes the first open parenthesis and ends the routine.
What else can you create? Try using what you just learned to
create an AutoLISP routine that draws a blue line.
55
Top AutoCAD Customization Tips
Chapter 5
Miscellaneous
Some aspects of customization are not easily categorized. In this
chapter, I explain how to:
Create a custom function in the calculator
Share tool palettes with colleagues
1. Start a command.
Your line’s start point is now set at the center of the rectangle
and you can continue the command.
57
Top AutoCAD Customization Tips
When you click a function, you see a tooltip giving you the full
format of the function. You can use this format to create your
own functions. For example, mee (midpoint between two endpoints)
is (end+end)/2. So, to find the midpoint between two nodes (rather
than two endpoints), you would use (nod+nod)/2.
58
Top AutoCAD Customization Tips
Then, your custom variable appears on the list and you can use
it like one of the variables that come with AutoCAD. You can
see mnn at the very bottom of the list.
59
Top AutoCAD Customization Tips
60
Top AutoCAD Customization Tips
But what if you want to share them with others? You can share
tool palettes by exporting them to a file. Then others import the same
file to access the tool palettes.
61
Top AutoCAD Customization Tips
Right click a tool palette or group and choose Export from the
menu. To export all palette groups, right-click a palette group and
choose Export All.
Click Save.
62
Top AutoCAD Customization Tips
63
Top AutoCAD Customization Tips
SUBSCRIBE
Don’t miss!
Top 25 Productivity Tips Every AutoCAD
User Should Know
Some examples:
Only $9.95!
GET IT NOW!
64