- •Foreword
- •Preface
- •Is This Book for You?
- •How This Book Is Organized
- •How to Use This Book
- •Doing the Exercises
- •Conventions Used in This Book
- •What the Icons Mean
- •About the CD-ROM
- •Other Information
- •Contacting the Author
- •Acknowledgments
- •Contents at a Glance
- •Contents
- •Getting Acquainted with AutoCAD and AutoCAD LT
- •Starting AutoCAD and AutoCAD LT
- •Creating a New Drawing
- •Using the AutoCAD and AutoCAD LT Interface
- •Creating Your First Drawing
- •Saving a Drawing
- •Summary
- •Creating a New Drawing from a Template
- •Working with Templates
- •Opening a Drawing with Default Settings
- •Opening an Existing Drawing
- •Using an Existing Drawing as a Prototype
- •Saving a Drawing Under a New Name
- •Summary
- •The Command Line
- •Command Techniques
- •Of Mice and Pucks
- •Getting Help
- •Summary
- •Typing Coordinates
- •Displaying Coordinates
- •Picking Coordinates on the Screen
- •Locating Points
- •Summary
- •Unit Types
- •Drawing Limits
- •Understanding Scales
- •Inserting a Title Block
- •Common Setup Options
- •The MVSETUP Command
- •Summary
- •Using the LINE Command
- •Drawing Rectangles
- •Drawing Polygons
- •Creating Construction Lines
- •Creating Rays
- •Summary
- •Drawing Circles
- •Drawing Arcs
- •Creating Ellipses and Elliptical Arcs
- •Making Donuts
- •Placing Points
- •Summary
- •Panning
- •The ZOOM Command
- •Aerial View
- •Named Views
- •Tiled Viewports
- •Snap Rotation
- •User Coordinate Systems
- •Isometric Drawing
- •Summary
- •Editing a Drawing
- •Selecting Objects
- •Summary
- •Copying and Moving Objects
- •Using Construction Commands
- •Creating a Revision Cloud
- •Hiding Objects with a Wipeout
- •Double-Clicking to Edit Objects
- •Grips
- •Editing with the Properties Palette
- •Selection Filters
- •Groups
- •Summary
- •Working with Layers
- •Changing Object Color, Linetype, and Lineweight
- •Working with Linetype Scales
- •Importing Layers and Linetypes from Other Drawings
- •Matching Properties
- •Summary
- •Drawing-Level Information
- •Object-Level Information
- •Measurement Commands
- •AutoCAD’s Calculator
- •Summary
- •Creating Single-Line Text
- •Understanding Text Styles
- •Creating Multiline Text
- •Creating Tables
- •Inserting Fields
- •Managing Text
- •Finding Text in Your Drawing
- •Checking Your Spelling
- •Summary
- •Working with Dimensions
- •Drawing Linear Dimensions
- •Drawing Aligned Dimensions
- •Creating Baseline and Continued Dimensions
- •Dimensioning Arcs and Circles
- •Dimensioning Angles
- •Creating Ordinate Dimensions
- •Drawing Leaders
- •Using Quick Dimension
- •Editing Dimensions
- •Summary
- •Understanding Dimension Styles
- •Defining a New Dimension Style
- •Changing Dimension Styles
- •Creating Geometric Tolerances
- •Summary
- •Creating and Editing Polylines
- •Drawing and Editing Splines
- •Creating Regions
- •Creating Boundaries
- •Creating Hatches
- •Creating and Editing Multilines
- •Creating Dlines
- •Using the SKETCH Command
- •Digitizing Drawings with the TABLET Command
- •Summary
- •Preparing a Drawing for Plotting or Printing
- •Creating a Layout in Paper Space
- •Working with Plot Styles
- •Plotting a Drawing
- •Summary
- •Combining Objects into Blocks
- •Inserting Blocks and Files into Drawings
- •Managing Blocks
- •Using Windows Features
- •Working with Attributes
- •Summary
- •Understanding External References
- •Editing an Xref within Your Drawing
- •Controlling Xref Display
- •Managing Xrefs
- •Summary
- •Preparing for Database Connectivity
- •Connecting to Your Database
- •Linking Data to Drawing Objects
- •Creating Labels
- •Querying with the Query Editor
- •Working with Query Files
- •Summary
- •Working with 3D Coordinates
- •Using Elevation and Thickness
- •Working with the User Coordinate System
- •Summary
- •Working with the Standard Viewpoints
- •Using DDVPOINT
- •Working with the Tripod and Compass
- •Getting a Quick Plan View
- •Shading Your Drawing
- •Using 3D Orbit
- •Using Tiled Viewports
- •Defining a Perspective View
- •Laying Out 3D Drawings
- •Summary
- •Drawing Surfaces with 3DFACE
- •Drawing Surfaces with PFACE
- •Creating Polygon Meshes with 3DMESH
- •Drawing Standard 3D Shapes
- •Drawing a Revolved Surface
- •Drawing an Extruded Surface
- •Drawing Ruled Surfaces
- •Drawing Edge Surfaces
- •Summary
- •Drawing Standard Shapes
- •Creating Extruded Solids
- •Drawing Revolved Solids
- •Creating Complex Solids
- •Sectioning and Slicing Solids
- •Using Editing Commands in 3D
- •Editing Solids
- •Listing Solid Properties
- •Summary
- •Understanding Rendering
- •Creating Lights
- •Creating Scenes
- •Working with Materials
- •Using Backgrounds
- •Doing the Final Render
- •Summary
- •Accessing Drawing Components with the DesignCenter
- •Accessing Drawing Content with Tool Palettes
- •Setting Standards for Drawings
- •Organizing Your Drawings
- •Working with Sheet Sets
- •Maintaining Security
- •Keeping Track of Referenced Files
- •Handling Errors and Crashes
- •Managing Drawings from Prior Releases
- •Summary
- •Importing and Exporting Other File Formats
- •Working with Raster Images
- •Pasting, Linking, and Embedding Objects
- •Summary
- •Sending Drawings
- •Opening Drawings from the Web
- •Creating Object Hyperlinks
- •Publishing Drawings
- •Summary
- •Working with Customizable Files
- •Creating Keyboard Shortcuts for Commands
- •Customizing Toolbars
- •Customizing Tool Palettes
- •Summary
- •Creating Macros with Script Files
- •Creating Slide Shows
- •Creating Slide Libraries
- •Summary
- •Creating Linetypes
- •Creating Hatch Patterns
- •Summary
- •Creating Shapes
- •Creating Fonts
- •Summary
- •Working with Menu Files
- •Customizing a Menu
- •Summary
- •Introducing Visual LISP
- •Getting Help in Visual LISP
- •Working with AutoLISP Expressions
- •Using AutoLISP on the Command Line
- •Creating AutoLISP Files
- •Summary
- •Creating Variables
- •Working with AutoCAD Commands
- •Working with Lists
- •Setting Conditions
- •Managing Drawing Objects
- •Getting Input from the User
- •Putting on the Finishing Touches
- •Summary
- •Understanding Local and Global Variables
- •Working with Visual LISP ActiveX Functions
- •Debugging Code
- •Summary
- •Starting to Work with VBA
- •Writing VBA Code
- •Getting User Input
- •Creating Dialog Boxes
- •Modifying Objects
- •Debugging and Trapping Errors
- •Moving to Advanced Programming
- •A Final Word
- •Installing AutoCAD and AutoCAD LT
- •Configuring AutoCAD
- •Starting AutoCAD Your Way
- •Configuring a Plotter
- •System Requirements
- •Using the CD with Microsoft Windows
- •What’s on the CD
- •Troubleshooting
- •Index
Customizing
Commands,
Toolbars, and
Tool Palettes
Customizing AutoCAD and AutoCAD LT can increase your efficiency and productivity. The time spent in preparation will be paid back
many times. Before you start customizing, you need to know some basics that apply to almost all customization. After you understand these basics, the process becomes much easier.
Overall, AutoCAD LT offers less customizability than AutoCAD; however, most of the features in this chapter apply to both AutoCAD and AutoCAD LT.
Working with Customizable Files
The capability to customize AutoCAD and AutoCAD LT is based on the fact that most of the support files are text files that you can edit yourself. Table 29-1 lists the most important files and their functions. Some customization can be done using dialog boxes.
Figure 29-1 shows a portion of one of these files, acad.pgp, which lists command shortcuts, or aliases. The equivalent file for AutoCAD LT is aclt.pgp.
29C H A P T E R
In This Chapter
Understanding the basics of customization
Creating keyboard shortcuts for commands
Customizing the toolbars
Customizing tool palettes
890 Part VI Customizing AutoCAD
Figure 29-1: Acad.pgp, one of the customizable files.
Table 29-1: Customizable Files
AutoCAD Filename |
AutoCAD LT Filename |
Function |
|
|
|
sample.cus |
sample.cus |
Custom dictionary file. You can add words to the |
|
|
custom dictionary for use with the SPELL command. |
acad.pgp |
aclt.pgp and |
Program parameters file. This file is generally used to |
|
acad.pgp |
create keyboard shortcuts (called aliases) for commands. |
acad.mnu |
aclt.mnu |
Template menu file. You can also create your own |
|
|
menu template files. |
acad.mnl |
N/A |
AutoLISP routines used by AutoCAD’s main menu. If you |
|
|
create your own menus, you can have an MNL file with |
|
|
the same name as your menu for AutoLISP routines. |
|
|
AutoCAD only. |
acad.mns |
aclt.mns |
Menu source file generated from the template MNU |
|
|
file. You can also create your own menu source files |
|
|
from custom template files. |
acad2005.cfg |
aclt2005.cfg |
Configuration file for storing digitizer and other settings. |
|
|
Usually, you should use the Options dialog box to make |
|
|
these selections instead of manually editing this file. |
|
|
See Appendix A for more information about this file. |
acad.dcl |
aclt.dcl |
Dialog Control Language (DCL) file. This file describes |
|
|
the standard dialog boxes. You usually don’t edit this |
|
|
file, but you can create your own DCL files to create |
|
|
dialog boxes. |
Chapter 29 Customizing Commands, Toolbars, and Tool Palettes |
891 |
AutoCAD Filename |
AutoCAD LT Filename |
Function |
|
|
|
acad.lin |
aclt.lin and |
Linetype definition file. You can also create your own |
|
acad.lin |
linetype definition (LIN) files or add your own definitions |
|
|
to acad.lin. |
acad.lsp |
N/A |
AutoCAD’s AutoLISP file. You can create this file from |
|
|
scratch. If it exists, you can edit or add to this file to |
|
|
automatically load AutoLISP routines. Other customiza- |
|
|
ble LSP files are discussed in Chapter 35. AutoCAD only. |
acad.mln |
N/A |
AutoCAD’s multiline library file. AutoCAD only. |
acad.pat |
aclt.pat and |
AutoCAD’s hatch pattern file. You can also create |
|
acad.pat |
your own. |
*.pc3 |
*.pc3 |
Plot configuration files. You can also create your own. A |
|
|
PC3 file contains all configuration settings for a plotter. |
|
|
This is not a text file; you customize it using a dialog box. |
|
|
For more information, see Chapter 17 and Appendix A. |
|
|
You can use these files with the Batch Plotting Utility. |
acad.fmp |
aclt.fmp |
Font mapping file. Use this file to specify substitute fonts, |
|
|
whether or not the original fonts are available on your |
|
|
system. |
acad.psf |
aclt.psf |
PostScript support file. It is used for the PSOUT and |
|
|
PSFILL commands. |
acad.slb |
aclt.slb |
Slide library file, used for hatch pattern examples in |
|
|
menus. You can use this file or create your own slide |
|
|
libraries. This is not a text file; see Chapter 30 for an |
|
|
explanation of how to create a slide library. |
*.scr |
*.scr |
A script file that you create and name. Script files are |
|
|
macros of commands and options that run automatically. |
*.shp |
*.shp |
A shape file that you create and name. Shape files |
|
|
usually hold fonts but can hold other shapes as well. |
|
|
A shape file is then compiled into a file with an SHX |
|
|
extension for more-efficient use. |
acad.rx |
N/A |
A list of ARX (an interface for programming AutoCAD) |
|
|
applications that load automatically. AutoCAD only. |
mtextmap.ini |
mtextmap.ini |
Font mapping for the appearance of text in the MTEXT |
|
|
editor. |
acad.unt |
aclt.unt |
A file that defines every conceivable type of unit. |
|
|
|
Editing customizable files
To customize AutoCAD or AutoCAD LT, you usually have to edit the appropriate customizable file. These files are often in text-only (ASCII) format. To edit them, you need a text editor, which is like a word processor but does not place any codes in the file. Files that are not in ASCII format generally have an interface in the program for editing them. For most of the ASCII files, you
892 Part VI Customizing AutoCAD
can use Notepad, which comes with Windows. All major word processors let you save documents as Text Documents — just remember not to click that Save button until you’ve specified the right file format.
Backing up customizable files
Before editing any preexisting files, back them up. Some of these files, especially the menu files, are critical to the program’s functioning. You should back up in three stages:
Back up the original file as it came out of the box. Keep a disk with all the customizable files that you might ever edit in their original form.
After you edit the file, back it up before each editing session. This way you always have your most recent version of the file. If you make a mistake, it’s easy to copy that file on top of the one with the mistake and put everything back to normal.
After you edit a file, back it up again so that you have it in case your hard drive crashes or you need to reinstall AutoCAD or AutoCAD LT.
In some cases, it’s safer to create your own files than to edit the original file. For example, when customizing menus, you can copy acad.mnu or aclt.mnu to a file named mymenu.mnu, edit mymenu.mnu, and then load your new menu instead of the standard menu.
This means you should have two disks, one with the original customizable files, and one with your most recent versions of them. At the very least, these disks should contain the following files:
acad.lin/aclt.lin
acad.lsp (AutoCAD only)
acad.mln (AutoCAD only)
acad.mnl (AutoCAD only)
acad.mns/aclt.mns
acad.mnu/aclt.mnu
acad.pat/aclt.pat
acad.pgp/aclt.pat
You may also want to back up templates that you’ve created.
You’ll use these disks not only when you make a mistake, but also whenever you need to reinstall AutoCAD or AutoCAD LT — whether due to hard-disk failure, a virus on your system, the replacement of your old computer with a new one, or some other reason. Also, when you upgrade AutoCAD or AutoCAD LT to the next release, you can usually continue to work with your familiar, customized files.
Using the command-line form of commands
For many customization tasks, you need to work with commands. When you create a script file, which is a series of commands, or when you edit the menu file, you need to type out the commands you want to execute. In these cases, the customizable files can only contain the command-line form of the commands. You have no way to enter values in a dialog box from within a script or menu file. As a result, you need to learn a whole new way of working — the old-fashioned way, by typing commands on the command line.
Chapter 29 Customizing Commands, Toolbars, and Tool Palettes |
893 |
Tip |
If you’re not sure of the command name but know the menu or toolbar item, execute the |
|
command on the menu or toolbar and then press Esc. You see the command name on the |
|
command line. |
|
A number of commands have a non-dialog-box version. Several commands can also be run |
|
in their command-line version by placing a hyphen (-) before the command name. For some |
|
commands that have no command-line equivalent, you can use system variables to create the |
|
same effect. Table 29-2 lists these commands. |
|
Table 29-2: Command-Line Forms of Commands |
|
|
Command |
Command-Line Form |
|
|
ARCHIVE |
-ARCHIVE (AutoCAD only) |
ARRAY |
-ARRAY |
ATTDEF |
-ATTDEF |
ATTEDIT |
-ATTEDIT |
ATTEXT |
-ATTEXT |
BHATCH |
-BHATCH |
BLOCK |
-BLOCK |
BOUNDARY |
-BOUNDARY |
COLOR |
-COLOR |
DDPTYPE |
PDMODE, PDSIZE |
DDVPOINT |
VPOINT |
DSETTINGS |
ORTHO, SNAP, GRID, ISOPLANE, AUTOSNAP, SNAPTYPE |
ETRANSMIT |
-ETRANSMIT |
EXPORT |
DXFOUT, STLOUT (AutoCAD only), BMPOUT, PSOUT, ACISOUT (AutoCAD only), |
|
3DSOUT (AutoCAD only), WMFOUT |
GROUP |
-GROUP |
HATCHEDIT |
-HATCHEDIT |
HYPERLINK |
-HYPERLINK |
IMAGE |
-IMAGE |
INSERT |
-INSERT |
LAYER |
-LAYER |
LAYOUT |
-LAYOUT |
LINETYPE |
-LINETYPE |
MTEXT |
-MTEXT |
OSNAP |
-OSNAP |
PAN |
-PAN |
Continued
894 Part VI Customizing AutoCAD
|
Table 29-2 (continued) |
|
|
Command |
Command-Line Form |
|
|
PARTIALOAD |
-PARTIALOAD (AutoCAD only) |
PARTIALOPEN |
-PARTIALOPEN (AutoCAD only) |
PLOT |
-PLOT |
PLOTSTAMP |
-PLOTSTAMP |
PLOTSTYLE |
-PLOTSTYLE |
PROPERTIES |
CHANGE, CHPROP, -COLOR, -LAYER, -LINETYPE, -LTSCALE, CELTYPE, |
|
CELTSCALE, ELEV, THICKNESS |
PURGE |
-PURGE |
RENAME |
-RENAME |
STYLE |
-STYLE |
TOOLBAR |
-TOOLBAR |
UNITS |
-UNITS |
VBARUN |
-VBARUN (AutoCAD only) |
VIEW |
-VIEW |
WBLOCK |
-WBLOCK |
XBIND |
-XBIND |
XREF |
-XREF |
|
|
|
In addition, you can use the dimension variables to format dimensions in place of using the |
|
DIMSTYLE command, which opens the Dimension Style Manager dialog box. See the discus- |
|
sion of the -DIMSTYLE command in Chapter 15. |
|
The FILEDIA system variable determines whether a dialog box opens for commands, such |
|
as SAVEAS and OPEN, that request filenames. When FILEDIA is set to 1, the default dialog |
|
boxes open. |
Note |
Even if FILEDIA is set to 1, if a script or AutoLISP/ObjectARX program is active, the command |
|
prompt is used instead of a dialog box. You can still set the FILEDIA system variable to 0, but |
|
be sure to change it back again at the end of your script or program. (Scripts are available in |
|
AutoCAD LT, but not AutoLISP or ObjectARX programs.) |
Documenting your files
Placing comments in customized files to explain how you customized them is standard practice. Although your customizations may seem obvious at the time, if you go back to a file later, you may not understand what you were trying to accomplish. Also, other people may need some explanation.