
- •Contents
- •Contents at a Glance
- •Acknowledgments
- •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
- •Foreword
- •Credits
- •About the Author
- •Summary
- •AutoCAD’s Advantages
- •Comparing AutoCAD and AutoCAD LT
- •Starting AutoCAD and AutoCAD LT
- •Creating a New Drawing
- •Using the AutoCAD and AutoCAD LT Interface
- •Creating a New Folder
- •Using the Interface
- •Saving a Drawing
- •Closing a Drawing and Exiting from AutoCAD and AutoCAD LT
- •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 and Dynamic Input
- •Command Techniques
- •Of Mice and Pucks
- •Getting Help
- •Summary
- •Typing Coordinates
- •Displaying Coordinates
- •Picking Coordinates on the Screen
- •Overriding Coordinate Settings
- •Locating Points
- •Summary
- •Choosing Unit Types
- •Drawing Limits
- •Understanding Scales
- •Creating a Title Block
- •Specifying Common Setup Options
- •Customizing with the MVSETUP Command
- •Using the Setup Wizards
- •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
- •Using the ZOOM Command
- •Using Aerial View
- •Saving Named Views
- •Working with Tiled Viewports
- •Using Snap Rotation
- •Understanding User Coordinate Systems
- •Creating Isometric Drawings
- •Summary
- •Editing a Drawing
- •Selecting Objects
- •Summary
- •Copying and Moving Objects
- •Resizing Commands
- •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
- •Customizing the spelling dictionary
- •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
- •Creating and Using Dynamic 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
- •Displaying 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 the Customization File
- •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
- •Summary
- •A Final Word
- •Installing AutoCAD and AutoCAD LT
- •Configuring and Using Workspaces
- •Configuring AutoCAD
- •Starting AutoCAD Your Way
- •Configuring a Plotter
- •Discovering AutoCAD and AutoCAD LT
- •Accessing Technical Support
- •Autodesk User Groups
- •Internet Resources
- •System Requirements
- •Using the CD-ROM with Microsoft Windows
- •What’s on the CD-ROM
- •Troubleshooting
- •Index

Chapter 32 Creating Shapes and Fonts 997
Creating Fonts
AutoCAD’s support for TrueType fonts makes so many fonts available that the need to create your own is certainly less than with earlier versions. However, you might want to add special symbols to some existing fonts, especially if you often use these symbols within text.
Font files use the same codes to define the characters as shape files. They have the following unique characteristics:
The shapenumber part of the definition must correspond to the ASCII code value for the character you’re defining. To find these codes, look at the sample fonts in the Help file (choose Help Help Contents Customization Guide Shapes and Shape Fonts Create Shape Definition Files Sample Files). Fonts generally use either hexadecimal or decimal format.
The shapename part of the definition is lowercase and is usually used to label the character. For example, it uses ucp for uppercase p and lcr for lowercase r. The sample files mentioned in the previous item use these codes.
The file must include a special shape number 0 that defines the entire font, using the following syntax:
*0,4,font-name above,below,modes,0
The above value specifies how far above the baseline that uppercase letters extend. The below value specifies how far below the baseline that lowercase letters, such as p or q, extend. Together, these two values define the size of the characters. AutoCAD uses these values to scale letters when you define a text height for the font. Modes should be 0 for a horizontal font and 2 for a font that supports both horizontal and vertical orientations. For example, a header for a font named arch with capital letters 21 units high and lowercase letters that extend 7 units below the line could be:
*0,4,arch
21,7,0,0
You must define the line feed (LF), which drops down one line without drawing so that lines of text can be placed beneath each other. The line feed is ASCII code 10.
You need to create a start point and endpoint with the pen up to create spacing between letters. See the previous exercise for an example.
As with all shapes, you probably want to use AutoCAD to draw all of the characters on a grid with a spacing of 1. Decide on the height of the letters and be consistent.

998 Part VI Customizing AutoCAD
Big Fonts and Unicode Fonts
The Japanese and Chinese written languages use fonts with thousands of characters because each character represents a word. AutoCAD uses big fonts to support these languages. It is beyond the scope of this book to go into detail about how to create these fonts, but a short explanation is useful.
Big font files use special codes to allow for the larger number of shapes. Big fonts allow up to 65,535 shape numbers. Unicode fonts support the ISO10646 standard, which uses 16-bit encoding to support many languages in one font file. If you open one of the .shp files, you’ll see characters for all of the letters that may have accents in French, Spanish, and so on. All of the fonts in AutoCAD are now compliant with this standard.
The advantage of Unicode fonts is that characters that you type appear the same in all systems and countries. This is important if you exchange drawings with clients or colleagues in other countries. Unicode fonts use a special header that includes two extra codes.
Unicode special characters can be inserted by typing \u+ and the hexadecimal Unicode value in the font file. (For this reason, Unicode font files use hexadecimal shape numbers.) For example, the hexadecimal code for the plus/minus sign is 00B1. If you type \u+00b1 and press Enter (using DTEXT in this example), you get the plus/minus sign. (It works with multiline text, too.)
If you don’t need the additional capabilities of big fonts or Unicode fonts, you can create fonts without them.
Summary
In this chapter, you read about how to create shapes. You discovered how to:
Use shape files when you need to insert a shape many times, while using as little storage space as possible
Create fonts using shape files with a few special codes that define both the font as a whole and each character
In the next chapter, I explain how to customize menus.
|
|
|

Customizing Menus
You probably use the AutoCAD and AutoCAD LT menus all the time. (If you don’t, you can skip this chapter.) Although the
menus are designed to be useful for most people, the whole point of customization is that everyone has different needs. For example, you can draw easier and faster by customizing the menus to suit your own individual requirements. Not only can you add commands to a menu, but you can also add menu items consisting of a series of commands that run just like a macro. If you’re using AutoCAD, you can even add AutoLISP routines to your menus. You can edit the default menu or create your own menu. You may want to create specialized menus that are used only for one drawing — for example, a menu to help clients view a drawing. Menu customization includes the drop-down menu, mouse or puck buttons, toolbars (covered in Chapter 29), shortcut menus, image-tile menus, keyboard shortcuts, and temporary override keys. The only limit is your imagination, and the time that you can devote to customization.
Working with the Customization File
The AutoCAD or AutoCAD LT menu is contained in a file that you don’t edit directly; instead, you use the Customize User Interface, or CUI, dialog box to modify the menu.
New |
In AutoCAD 2006 and AutoCAD LT 2006, the entire menu file has |
Feature |
changed. In place of the MNU, MNS, and MNC files is one file in XML |
|
|
|
format, acad.cui or aclt.cui. Instead of editing the file directly, |
|
you use a dialog box. |
Understanding the menu file
The main menu file is acad.cui in AutoCAD, and aclt.cui in AutoCAD LT. You can either customize this file, or load another CUI file. I discuss using this file to customize toolbars in Chapter 29. In this chapter, I cover customization of the menu, including the dropdown menu, shortcut (right-click) menus, mouse buttons, keyboard shortcuts (including temporary override keys), tablet menus, and image-tile menus.
Caution |
Don’t even think about customizing the menu until you’ve backed |
|
up at least acad.cui or aclt.cui. It is possible to corrupt the |
|
menu file. If you get stuck, then you can find the original file in |
|
C:\Program Files\AutoCAD 2006\UserDataCache\Support |
|
(if you used the default installation location). For AutoCad LT, go to |
33C H A P T E R
In This Chapter
Understanding and working with
the customization file
Loading full and partial customization files
Creating commands and macros for dropdown menus
Creating shortcut menus
Creating image-tile menus
Creating keyboard shortcuts
c:/Program Files/AutoCAD LT/2006/UserDataCache/Support

1000 Part VI Customizing AutoCAD
In additional to the main menu file, AutoCAD and AutoCAD LT use these other files:
custom.cui: This file is specifically meant to be used for customization. It is a partial customization file, which means that you use it to add on to the main customization file. For example, you can add a toolbar and a menu that you use with the regular menu.
acad.mnr or aclt.mnr: This file contains bitmap images used by the menu, such as toolbar icons and icons on menus.
acad.mnl: This file contains AutoLISP routines used by the menu. If you create a new menu file that contains AutoLISP routines, then AutoCAD creates this file automatically. (AutoCAD only.)
You can create your own full or partial menu files using any name that you want. You’ll have the best results if you place all of your menu files in the same folder as the main customization file.
Note |
To find the location of acad.cui or aclt.cui, choose Tools Options and then click the |
|
Files tab. Expand the Customization Files item, and then expand the Main Customization File |
|
item. Browse to that location in Windows Explorer. |
Loading and unloading customization files
There are two types of customization files: partial and main (full). A partial customization file usually has only one or two drop-down menus (or toolbars). You can then load this partial menu along with your regular menu. If your menu customization consists of simply adding a few menu items, then you may want to create a partial customization file and add it to your current menu.
On the other hand, you may also want to have complete alternate menus, in which case you can customize the main menu. Perhaps two different people work on one computer and have different menu needs. For example, you may find it useful to have one menu for architectural drawings, another for mechanical drawings, and a third for electrical schematics. Of course, you can customize your one main menu to better suit your needs.
Loading and unloading a main customization file
Using your own customization file is a good way to keep the original file safe, in case you want to go back to it. Generally, you start by making a copy of the default main customization file, acad.cui or aclt.cui.
You can copy the main customization file (or any file, for that matter) in Windows Explorer. Right-click the file and choose Copy. Then right-click in any blank space in the Explorer window and choose Paste. The new file appears at the bottom of the list of files. Click the file to select it, and then click it again to change its name. Enter the new name, and then press Enter.
You can use only one main customization file at a time. If you want to work with your own customization file, you first need to unload the current customization file. Use the new CUILOAD command on the command line both to unload and load a customization file. The Load/Unload Customizations dialog box opens, as shown in Figure 33-1. Choose the main customization file that you want to unload and click Unload. (Although there is also a new CUIUNLOAD command, it opens the same dialog box as the CUILOAD command.)

Chapter 33 Customizing Menus 1001
Figure 33-1: The Load/Unload Customizations dialog box.
To load a new main customization file, follow these steps:
1.In the Load/Unload Customizations dialog box, choose the current main customization file and click Unload.
2.Click the Browse button.
3.Navigate to and select the new main customization file. Click Open.
4.In the Load/Unload Customizations dialog box, click Load.
5.Click Close to close the dialog box.
6.Choose Tools Customize Interface (or type cui on the command line or in the dynamic input tooltip).
7.In the Customizations In pane, the top drop-down list should show All Customization Files or Main CUI File. The top item in the pane lists the current main customization file. It may still show the customization file that you unloaded; in that case, right-click it and choose Rename. Enter the name of the customization file that you loaded, and press Enter to match the customization group name to the file name.
When you start AutoCAD or AutoCAD LT, the last customization file that you used, which is stored in the Windows registry, is loaded. If you want to use a new menu while in AutoCAD or AutoCAD LT, you must unload the current customization file and load the new one.
Loading and unloading partial customization files
You can use the Custom partial customization file that comes with AutoCAD (or AutoCAD LT), or create your own partial customization files. To create a new partial customization file, follow these steps:
1.On the Transfer tab of the Customize User Interface dialog box, choose New from the Customizations In drop-down list.
2.From the drop-down list, choose Save As. Enter a name for the new file in the Save As dialog box. Make sure that you use a name that is different from all other CUI files.

1002 Part VI Customizing AutoCAD
3.To use the file, go to the Customize tab and choose Main CUI File from the drop-down list in the Customizations In pane. Then click the Load Partial Customization File button to the right of the drop-down list. In the Open dialog box, locate the partial CUI file and click Open.
4.Choose Main CUI File again from the drop-down list. You should now see the new file listed under the expanded Partial CUI Files item.
You can load more than one partial customization file along with the main customization file. For example, you might have one partial customization file for 2D work and another for 3D work; sometimes, you might want both of them.
You can load and unload partial customization files in two ways:
Use the CUILOAD command as explained in the previous section.
Use the CUI command to open the Customize User Interface dialog box. To load a file, click the Load Partial Customization File button in the Customizations In pane.
Select the file and click Open. In the Customize User Interface dialog box, click Apply.
After you have loaded a partial customization file, check to make sure that it has been loaded. In the Customize User Interface dialog box, choose Main CUI File from the top drop-down list. Expand the Partial CUI Files item in the Customizations in Main CUI pane, and make sure that your partial CUI file is listed.
To unload a partial customization file, use one of these methods:
Use the CUIUNLOAD command. Follow the instructions for unloading a main CUI file described in the previous section.
In the Customize User Interface dialog box, right-click the file and choose Unload CUI File.
Transferring customization between files
You can also move customization items between customization files, using the Transfer tab of the Customize User Interface dialog box. You can transfer items from a loaded file to any menu file, including MNU, MNS, and CUI files. You can also transfer items between partial customization files or between a main customization file and a partial one.
When you display the Transfer tab, the current customization file is listed in the left pane. To open another file, click the Open Customization File button in the right pane, choose the file that you want to use, and click Open.
In each pane, expand the element that you want to transfer. For example, if you want to transfer menus, expand the menu item on each side. You then see the actual menus in each file that is listed. To transfer an item, drag it from one pane to the other. Make sure that you are dragging to the same type of item, that is, menu to menu or toolbar to toolbar.
When you’re done, click OK to close the Customize User Interface dialog box.