Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Autocad 2005 And Autocad LT 2005 Bible (2004).pdf
Скачиваний:
92
Добавлен:
17.08.2013
Размер:
32.22 Mб
Скачать

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.