- •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 33 Customizing Menus 1003
Working with Menu Files from Previous Releases
How do you bring your extensively customized menus from prior releases into the new menu system for 2006? It’s easy, because AutoCAD and AutoCAD LT take care of this for you.
To convert your MNU or MNS files to CUI files, open the Customize User Interface dialog box and click the Transfer tab. From the Customizations in New CUI File drop-down list, choose Open. Select the menu file and click Open. You now see the file, with the same name as before, but with a .cui file name extension. You still need to load the file, as explained earlier in this chapter.
You might want to continue to work with your MNU and MNS files if you are in an office that uses more than one version of AutoCAD, and everyone needs to share the same file. In that case, use the MENU command to open the Select Customization File dialog box. Choose Legacy Menu Template (*.mnu) or Legacy Menu File (*.mns) from the Files of Type drop-down list.
Customizing a Menu
When you first start customizing a customization file, the process may seem overwhelming. However, even small changes can be very useful. Start simple and take it from there.
Menu files include nine types of customizable content, as follows:
Toolbars let you choose commands from icons. I discuss customizing toolbars in Chapter 29.
Menus are the drop-down menus at the top of your screen.
Keyboard shortcuts come in two varieties. Regular keyboard shortcuts, such as Ctrl+C for the COPYCLIP command, execute commands. Temporary override keys (which I explain how to use in Chapter 4) temporarily override settings, such as OSNAP and ORTHO.
Shortcut menus appear when you click the right mouse button. (See Chapter 3 for more information on right-clicking.)
Button menus control the buttons on your mouse.
Tablet menus control the menu that can be overlaid on a digitizing tablet.
Tablet buttons control the multiple buttons on a puck that you use with a digitizing tablet.
The screen menu is AutoCAD’s original menu that used to appear at the right side of your screen. (This section does not exist in AutoCAD LT.) By default, it is not displayed, but it still exists in the menu file. In AutoCAD, you can display it by choosing Tools Options, clicking the Display tab, and checking the Display Screen Menu check box.
Image-tile menus create dialog boxes with images, such as the one that you see when you choose Draw Surfaces 3D Surfaces in AutoCAD.
1004 Part VI Customizing AutoCAD
Looking at a drop-down menu
The best way to start customizing a menu is to look at a drop-down menu and its corresponding representation in the Customize User Interface dialog box. Each type of menu content has its own unique features, but certain features apply to most, if not all, menu types.
Figure 33-2 shows the AutoCAD Format drop-down menu. (AutoCAD LT’s Format menu is slightly different.)
Figure 33-2: The AutoCAD Format drop-down menu.
Figure 33-3 shows the same menu displayed in the Customize User Interface dialog box. Compare this list to the menu shown in Figure 33-2.
Figure 33-3: The Format menu in the Customize User Interface dialog box.
Chapter 33 Customizing Menus 1005
In Figure 33-3, the Text Style item is selected, and the right side of the Customize User Interface dialog box shows the information relating to that item. Note that menu items have five elements:
Name: The name is what you actually see on the menu. The ellipsis (. . .) after a menu item provides a visual cue on the menu that these items open dialog boxes. The ampersand (&) places an underscore under the following letter. You can then type the letter to execute the menu item (instead of clicking the menu item with your mouse). The mouse buttons, tablet buttons, tablet menus, and shortcut menus do not display the name, but the name is required. (This was called a label in previous releases.)
Description: For drop-down menus, shortcut menus, and toolbars, the description appears on the status bar when you hover the cursor over the menu item or button. The other menu elements don’t use the description, although some of them let you enter one.
Macro: The macro is the command that the item executes. In the next section, I explain how to write menu macros. This can be a simple command, any group of commands, or an AutoLISP expression if you’re using AutoCAD. The following conventions are recommended:
•Add an apostrophe (‘) before commands that can be used transparently. (Otherwise, the commands won’t work transparently when chosen from the menu.)
•All other commands start with ^C^C, which is equivalent to pressing Esc twice. This cancels any other command that may be active. One Esc is generally enough, but occasionally two are necessary. (In rare situations, more might be needed.)
•The underscore is used before each command. This allows translation of the command into other languages. Your menus would automatically be translated into the equivalent French command in France!
Key(s): Shortcut keys and temporary override keys have a Key item, which specifies which key combination you use to execute the macro.
Element ID: This is a unique identifier that the program assigns automatically. In previous releases, it was used to link drop-down menu items and toolbar buttons to their status-bar help, and to link a keyboard shortcut to a menu item. You can still use this identifier for programming purposes. You cannot change the ID of an existing command, but you should add one for new commands that you create.
Images: Toolbar buttons and some menu items have images. Most people use only the small image, but you can specify large images on the Display tab of the Options dialog box (Tools Options). You can choose an image from the Button Image pane, or create your own image using the Button Editor. I cover the Button Editor in Chapter 29.
Drop-down and shortcut menus also have aliases that you use when referring to the menu. You can add an alias by clicking the Ellipsis button to the right of the alias item.
Note |
In Windows 2000 and XP, by default, the underscores appear only if you access the menu using |
|
the keyboard. To access a menu, press Alt and the underscores appear. Then type the under- |
|
scored letter to open the menu. To choose a menu item, type its underscored letter. To disable |
|
this behavior and display the underscores all of the time, choose Start Control Panel and |
|
choose Display. If you have Windows XP, choose the Appearance tab and click the Effects but- |
|
ton. Then uncheck the Hide Underlined Letters for Keyboard Navigation Until I Press the Alt Key |
|
check box. If you have Windows 2000, choose the Effects tab. Then uncheck the Hide Keyboard |
|
Navigation Indicators Until I Use the Alt Key check box. |
1006 Part VI Customizing AutoCAD
Writing menu macros
The menu macro is the heart of the menu. To enter a macro, click the text box to the right of the Macro item and start typing. If your macro is long, click the Ellipsis button at the right of the text box to open the Long String editor. You need to know a number of special characters and conventions in order to write menu macros. Table 33-1 lists some of the most common ones.
Table 33-1: Special Characters for Menu Macros
Character Description
;Equivalent to pressing Enter. The end of a line in a menu macro is also equivalent to pressing Enter. Use the semicolon when you need two returns at the end of a line, or when you want to indicate pressing Enter. Some commands, such as DTEXT/TEXT, also require a return to complete. You can also use ^M.
Space |
Similar to pressing Enter, except when entering text (to create a text object) that contains |
|
spaces (such as between words). Use between the command and its options. Note that |
|
you can even use a space on the command line for most commands. |
\Pauses for user input, such as picking a point or typing a value.
+Used at the end of a line to continue the macro on the next line.
*Placed at the beginning of a macro (before the ^C^C), this character repeats the macro until you end it by pressing Esc or choosing another menu item. For example, the POINT command works this way.
^P |
Turns on and off (toggles) the display of the menu macro, including menu prompts, on |
|
the command line. |
|
|
Note Because the backslash pauses for user input, you cannot use it to specify a path, as in C:\ Program Files\AutoCAD 2006\Support. Use the regular slash (/) instead.
Here is one macro from the Draw drop-down menu — Arc: Start, Center, Angle — that uses the backslash and the space:
^C^C_arc \_c \_a
Here’s how this command works:
^C^C Cancels any previous command.
_arc Starts the ARC command, thus enabling translation to another language version of AutoCAD or AutoCAD LT.
Space Equivalent to pressing the spacebar, which is the same as pressing Enter after typing arc on the command line. The command line displays the Specify start point of arc or [Center]: prompt.
\The backslash lets you specify a start point.
_c |
Chooses the Center option, also enabling translation to another language. |
Space |
Equivalent to pressing the spacebar, which is the same as pressing Enter after |
typing c on the command line (for the Center option). The command line displays the
Specify center point of arc: prompt.
Chapter 33 Customizing Menus 1007
\The backslash lets you specify a center point.
_a Chooses the Angle option. Because this is at the end of the command, you don’t need to specify a pause. The user specifies an angle and presses Enter, thus ending the command and drawing the arc.
The backslash allows for only one input, except when used with the SELECT command. Therefore, you can use the SELECT command in menu macros to collect a selection set, and then use another command with the Previous option to act on the entire selection set. For example:
^C^Cselect \move previous ;.1,0 ;
This macro cancels any existing command, starts the SELECT command, and lets you select as many objects as you want. You end object selection by pressing Enter. Then the macro automatically moves those objects to the right by 0.1 units.
Here are a few more examples of macros from earlier chapters.
You could place this macro on a drop-down menu to make a selected polyline 0.1-units wide:
^C^Cpedit \w .1 ;
You would use the following macro to automatically draw four circles with the specified centers and radius. It uses a plus sign near the end because the macro is too long to fit on one line.
^C^Ccircle 2,2 1.5 circle 6,2 1.5 circle 10,2 1.5 circle 14,2 1.5
You could use this macro to clean up a drawing. It uses CHPROP to select all of the objects in a drawing, and the Color option to change their color to ByLayer. Then it uses the LAYER command to freeze the layer named “no-plot,” and saves the drawing.
^C^Cchprop all c bylayer -layer f no-plot qsave
Keep in mind that using the All selection option is another way to select more than one object in a menu macro.
Swapping menus
Sometimes you want a menu item to display another menu item. This is called menu swapping. Here is an example of swapping in the Mouse Buttons Shift+Click Button 2: Snap Menu item:
$P0=SNAP $p0=*
This menu introduces some new special characters that are used in the menus. Because you cannot customize the pick button (which is button 1), the first button listed is the second button. In this case, pressing Shift and the second button (the right button on a two-button mouse) opens the Object Snap menu (as you probably already know).
The Object Snap menu is in the Object Snap Cursor menu, which is a shortcut menu. For the sake of compatibility with previous menus, this menu has an alias of POP0. This menu item switches you to the Object Snap shortcut menu, and displays that menu.
The special syntax is as follows:
$section=menugroup.menuname $section=menugroup.*
1008 Part VI Customizing AutoCAD
If the menu group is the same as that of the menu where you’re placing the macro, you can leave it out. The menu group name is the same as the customization group name, which is usually the name of the file — for example, ACAD for acad.cui. The menu name is either the menu’s label or an alias. The different sections or menu types have their own special abbreviations for menu swapping, as shown in Table 33-2.
Table 33-2: Menu-Section Abbreviations for Menu Referencing
Abbreviation |
Menu Section |
|
|
A1–A4 |
The AUX menus 1 through 4 |
B1–B4 |
The BUTTONS menus 1 through 4 |
P0–P16 |
The drop-down menus |
I |
The IMAGE menu |
T1–T4 |
The TABLET menus 1 through 4 |
|
|
Here’s another example from the AutoCAD Draw drop-down menu. You can find this item on |
|
the menu by choosing Draw Surfaces 3D Surfaces. This item swaps to and displays the |
|
3D |
Objects image tile menu, which has an alias of image_3DObjects. |
|
$I=ACAD.image_3dobjects $I=ACAD.* |
In Figure 33-16, later in this chapter, I show the image-tile portion of the menu that this |
|
3D |
Surfaces menu item displays. |
Tip |
You could use this technique for a custom menu that swaps to an image menu that inserts |
|
commonly used blocks. However, the tool palettes, which I cover in Chapter 26, are an easier |
|
way to accomplish a similar result. |
Customizing mouse buttons and tablet buttons
Although the Customizations In pane lists sections for both mouse buttons and tablet (puck) buttons, these sections are identical. You can add as many menu items as your input device has buttons. To add a button, right-click a mouse button section, such as Click or Shift+click, and choose New Button.
To add a command to a button, drag the command from the Command List pane to the mouse button in the Customizations In pane.
Note You can customize the Mouse Buttons and Tablet Buttons sections for full menus only, not for partial menus.
Here is the default Mouse Buttons Click section:
Button 2: Grips Menu: To see the macro for this item, select it and look in the Macro text box. The second button usually functions as a return (the semicolon at the end of the macro represents the return). The first part of the macro includes an expression in a programming language called DIESEL (which is beyond the scope of this book). However, its purpose is to display the Grips shortcut menu. The Grips shortcut menu only appears if you have a hot grip in your drawing.
Chapter 33 Customizing Menus 1009
Button 3: Snap Menu: The third button, if you have one, displays the Object Snap menu. You can change this to whatever you want.
Button 4: Cancel: ^C^C, is equivalent to pressing Esc twice.
Button 5: Toggle Snap: The macro, ^B, is equivalent to pressing Ctrl+B, which turns Snap on and off.
Button 6: Toggle Ortho: ^O, is equivalent to pressing Ctrl+L, which turns Ortho on and off. (Once upon a time, before Windows, Ctrl+O toggled Ortho on and off.)
Button 7: Toggle Grid: ^G, is equivalent to pressing Ctrl+G, which turns the grid on and off.
Button 8: Toggle Coords: ^D, is equivalent to pressing Ctrl+D, which toggles the coordinate display mode.
Button 9: Toggle Isoplane: ^E, is equivalent to pressing Ctrl+E, which switches to the next isometric plane.
Button 10: Toggle Table: ^T, is equivalent to pressing Ctrl+T, which turns the tablet on and off.
If you have a number of buttons on your pointing device, you can leave these macros as they are or change them to suit your needs.
Tip You can pan and zoom with the IntelliMouse. The MBUTTONPAN system variable controls the third button or wheel on your pointing device. By default, it’s set to 1, which supports panning and zooming. Set it to 0 to support the definition in the customization file.
The following exercise shows you how you can customize even a two-button device. Because you may be working on someone else’s computer, the exercise undoes the customization at the end.
STEPS: Customizing the Buttons Menu
1.Back up your menu files. (By default, these are acad.cui for AutoCAD and aclt.cui for AutoCAD LT.)
Caution |
Don’t continue this exercise until you’ve completed Step 1. If you’re working on someone |
|
else’s computer, ask permission before doing this exercise. |
2.To make a duplicate of acad.cui or aclt.cui, right-click the file in Windows Explorer and choose Copy from the shortcut menu. Right-click again and choose Paste. Windows places a copy of the file in the same folder.
Note |
To find the location of your menu files, choose Tools Options and click the Files tab. Double- |
|
click Customization Files Main Customization File to display the location of the menu files. |
3.Click the copied menu file and rename it ab1.cui (that’s the number one, not the letter L). Press Enter.
4.Open a drawing using any template. On the command line or in the dynamic input tooltip, type cuiload . In the Load/Unload Customizations dialog box, choose ACAD (or ACLT) and click Unload. Most of your menus and all of your toolbars disappear!
1010 Part VI Customizing AutoCAD
5.Click Browse. In the Select Customization File dialog box, choose ab1.cui and click Open. Back in the Load/Unload Customizations dialog box, click Load. All of your menus and toolbars reappear. Click Close to return to your drawing.
6.On the command line or in the dynamic input tooltip, type cui . In the Customizations
In pane of the Customize User Interface dialog box, right-click ACAD and choose Rename. Type ab1 to change the customization name to match the file name.
7.If you use a system mouse, double-click the Mouse Buttons item, and then double-click the Ctrl+click item. If you use a digitizing tablet or other non-system input device, doubleclick Legacy, then double-click Tablet Buttons to expand this item. Click the Button 2 item (the right mouse button on a 2-button mouse).
8.In the Command List pane, click the New button. In the Name text box of the Properties pane, enter Toggle Snap Mode . This lets you turn Snap on and off using Ctrl plus the
right button on your pointing device. Change the current macro to ^B. In the Element ID text box, type MMU_0010 to ensure that the new command has a unique ID.
Note If your menu doesn’t list a button for Ctrl+Click, then right-click this item and choose New Button.
9.Find the new Toggle Snap Mode command in the Command List pane’s list of commands and drag it to the Button 2 item. You should see a small left-facing arrow pointing directly to the Button 2 item.
10.Double-click Ctrl+Shift+Click in the Customizations In pane and click the Button 2 item.
Again click the New button in the Command List pane. In the Name text box of the Properties pane, type Toggle Ortho Mode . This lets you turn Ortho on and off using
Ctrl+Shift+right-click. (Notice that the Element ID is now MMU_0011.) In the Macro text box, type ^O .
11.Find the new Toggle Ortho Mode command in the Command List pane’s list of commands and drag it to the Ctrl+Shift+Click Button 2 item. You should see a small left-facing arrow pointing directly to the Button 2 item.
12.Click OK to return to your drawing.
13.Press and hold Ctrl and click the right button. The SNAP button on the status bar turns on (looks pushed in). Move your cursor around to verify that Snap is on. (If the cursor doesn’t snap to points, then PolarSnap is on. Right-click SNAP on the status bar and choose Grid Snap On.)
14.Hold Ctrl+Shift and click the right button. Orthomode turns on if it’s currently off, or turns off if it’s currently on.
15.Hold Ctrl+Shift and click the right button again to toggle Orthomode again.
16.To return to your original menu, enter cuiload on the command line or in the dynamic input tooltip to open the Customize User Interface dialog box. Choose AB1 and click Unload. Click Browse, choose acad.cui, and click Open. Click Load, and then click Close.
17.Again, try using Ctrl plus the right button and Ctrl+Shift+right-click. The button no longer works as before. Instead, both key combinations open the OSNAP shortcut menu.
Don’t save your drawing.
Chapter 33 Customizing Menus 1011
Customizing drop-down menus
The Menus section controls the drop-down (or pull-down) menus, which are the menus along the top of your screen. You can customize existing menus or add your own menu to the main customization file. You can also create a partial customization file with one or more menus.
Figure 33-4 shows the Edit menu in AutoCAD.
Figure 33-4: The Edit menu.
Figure 33-5 shows the Edit menu in the Customize User Interface dialog box. Compare it to Figure 33-4. Look for the separator lines and underscored letters.
Figure 33-5: The Edit menu in the Customize User Interface dialog box.
1012 Part VI Customizing AutoCAD
Here are the basic procedures for creating drop-down menus:
To add a menu, right-click the Menus item in the Customizations In pane and choose New Menu. The menu appears at the bottom of the list of menus. You can immediately edit the default name. Press Enter.
Note The name of a menu appears as the menu title. Keep these fairly short to keep the menu titles from running into each other. Don’t place spaces in menu title names — it becomes hard to distinguish where one menu ends and the next one starts.
To add a command (an item) to a menu, drag the command from the Command List pane to the menu’s name. If you already have items on the menu, you can drag above or below an existing item.
Caution |
To make sure that all commands are available, choose All Customization Files or Main CUI File |
|
from the Customizations In drop-down list, and choose All Commands from the Categories |
|
drop-down list. |
Tip |
To quickly locate a command in the Command List, click any command and type the first letter |
|
of the command. You automatically jump to commands starting with that letter. You can then |
|
scroll down to find the command that you need, which is nearby. |
To add a separator line below any item, right-click that item and choose Add Separator from the shortcut menu. You also see a separator line [--] in several places in Figures 33-4 and 33-5. The separator helps to organize a menu into logical sections.
To delete an item, right-click the item and choose Delete. Choose Yes in the confirmation message box.
Creating sub-menus
Sub-menus help you to organize your menu so that related commands stay together. Figure 33-6 shows the Draw menu, which has a number of sub-menus.
To add a sub-menu, right-click any menu item and choose New Sub-menu. Name the submenu the same way that would you name a regular menu. You also add commands to a sub-menu in the same way that you add commands to a menu.
Chapter 33 Customizing Menus 1013
Figure 33-6: The AutoCAD Draw menu with the
Solids and Setup sub-menus displayed.
Creating custom commands
You can create a custom command and place it on an existing menu or a new menu that you create, in either a main or a partial customization file. To create a custom command on a menu, do the following:
1.Choose the menu in the Customizations In pane.
2.Click New in the Command List pane.
3.In the Properties pane, shown in Figure 33-7, complete the following:
1014 Part VI Customizing AutoCAD
Figure 33-7: Specify the properties of a new command in the Properties pane.
•In the Name text box, replace the default name (Command1) with your own name for the command.
•Type a help description in the Description text box. This text appears on the status bar to further explain the function of the command when you hover the mouse cursor over the menu item.
•Write the macro in the Macro text box, using the macro syntax described in this chapter.
•New commands need an Element ID, but you can accept the default one that AutoCAD provides. You can change the ID if you want to. You could use the ID for programming purposes.
4.From the Categories drop-down list, choose Custom Commands so that you can find the command more easily. Drag the new command onto the menu.
5.If you want, you can associate an image with the menu, although this is more commonly done for toolbar buttons. The image will appear to the left of the command name on the menu. I explain how to use the Button Image pane and the Button Editor in Chapter 29.
6.Click OK.
STEPS: Creating a Drop-Down Partial Menu
1.If you haven’t already done so, back up the menu files. (These are the acad.cui, acad.mnr, and acad.mnl, or aclt.cui and aclt.mnr files.)
Caution |
Don’t continue with this exercise until you’ve completed Step 1. If you’re working on someone |
|
else’s computer, ask permission before doing this exercise. |
Chapter 33 Customizing Menus 1015
Note |
To find the location of your menu files, choose Tools Options and click the Files tab. |
|
Double-click Customization Files Main Customization File. |
2.Open a drawing using any template. Type cui on the command line or in the dynamic input tooltip.
3.To create a new partial customization file, click the Transfer tab of the Customize
User Interface dialog box, and click the Create a New Customization File button in either pane.
4.From either drop-down list, choose Save As. In the Save As dialog box, enter ab2 in the File Name text box. Click Save.
5.Click the Customize tab. The drop-down list in the Customizations In pane should show All Customization Files. Then click the Load Partial Customization File button
to the right of the drop-down list. In the Open dialog box, locate the ab2.cui file and click Open. (If you see a Warning about Workspaces message, click OK.)
6.Choose All Customization Files from the drop-down list. You now see AB2 listed when you expand the Partial CUI Files item. Double-click the AB2 item to expand it.
7.Right-click the AB2 item and choose New Menu. Enter AB2 to rename the menu.
8.To create a sub-menu, right-click AB2 and choose New Sub-menu. Enter &Special Edits to rename the sub-menu. (The ampersand allows you to open the menu by pressing Alt+S.)
9.To create the first custom menu item, click New in the Command List pane. In the Properties pane, enter the following:
Name: &Move .1 right
Description: Moves objects .1 unit to the right
Macro (after ^C^C): _select;\_move;_previous;;.1,0;; Element ID: AB_002a
In the Command List pane, choose the Move .1 right command, which is now highlighted, and drag it to the Special Edits sub-menu.
10.To create another custom command, again click New in the Command List pane. In the Properties pane, enter the following:
Name: &Pedit .1
Description: Sets polyline width to .1
Macro (after ^C^C): _pedit;\_w;.1;; Element ID: AB_002b
Drag the new command below the previous custom command.
11.To add a separator line, right-click the AB2 menu (under the Menus item) and choose Insert Separator.
12.To add an existing command to the main part of the menu (not the sub-menu), choose Customize . . . from the command list. Drag it up under the separator. (If it pops above the sub-menu, drag it down.)
13.To add one more custom command, click New. In the Properties pane, enter the following:
Name: &Cleanup
Description: Cleans up drawing before plotting
1016 Part VI Customizing AutoCAD
Macro (after ^C^C): Click the Ellipsis button at the end of the Macro text box and enter the macro shown in Figure 33-8. Then click OK. Element ID: AB_002c
Drag this new command to the bottom of your new menu.
Figure 33-8: The custom Cleanup command’s macro in the Long String Editor.
14.Click the Save All Current Customization Files button in the Customizations In pane. Click the Special Edits menu item. Your pane should look like Figure 33-9.
Figure 33-9: The new partial menu in the
Customizations In pane of the Customize User
Interface dialog box.
15. Click Apply and then click OK to close the Customize User Interface dialog box.
Note |
If the AB2 menu doesn’t appear, type cuiload . Unload and then reload AB2. |
16.Open ab33-a.dwg from the CD-ROM. Save it as ab33-01.dwg in your AutoCAD Bible folder.
17.Look at the menu. It should look like Figure 33-10. Notice the sub-menu and the separator line.
Figure 33-10: The AB2 menu, including the sub-menu.
Chapter 33 Customizing Menus 1017
18.To try out the menu, choose AB2 Special Edits Move .1 Right. At the Select objects: prompt, pick the vertical red line and right-click to end object selection. The menu macro moves the line 0.1 units to the right.
19.Choose AB2 Special Edits Pedit .1. At the Select polyline or [Multiple]: prompt, choose the green polyline. The polyline becomes 0.1-unit wide.
20.Choose AB2 Clean Up. The color of all of the objects changes to ByLayer, and the no-plot layer disappears.
21.Enter cuiload and unload AB2. Close the Load/Unload Customizations dialog box.
22.Save your drawing.
Note If you made a mistake and some of the items don’t work properly, edit the macros and try again.
Customizing shortcut menus
The shortcut menus appear at the cursor. In addition to the Object Snap menu, which appears when you press Shift and the right mouse button, and the Grips menu, which appears when there is a hot grip and you right-click, there are several other shortcut menus.
You access a shortcut menu by using the buttons on your mouse or puck. Therefore, the shortcut menus are accessed from the Buttons menu by swapping, as described earlier in this chapter.
You can customize shortcut menus that are specific to a command or to a selected object. For example, if you right-click when a polyline is selected, the shortcut menu includes a Polyline Edit item. However, if you right-click when a spline is selected, the shortcut menu includes a Spline Edit item instead. Because the appropriate shortcut menu appears depending on the context, that is, the object that is selected, shortcut menus are context-sensitive. For this reason, they are sometimes called context menus. You can create your own context menus.
To create a shortcut menu, you specify the following:
Name: Although no name appears at the top of a shortcut menu (unlike a drop-down menu), a name is required.
Description: The description is optional. The description would only appear if you turned the shortcut menu into a sub-menu, which you can do by dragging a shortcut menu in the Customize User Interface dialog box to a menu.
Aliases: Aliases are used to reference the shortcut menu from elsewhere in the menu. Aliases are assigned automatically, but you need to add an alias in a special format if you create your own shortcut menu. To specify the alias, click in the Alias text box, and then click the Ellipsis button to open the Aliases dialog box. Click at the end of the current line and press Enter to start a new line. Enter the new alias in the format appropriate for that type of shortcut menu, and then click OK to close the dialog box. See the next two sections for a description of these formats.
Element_ID: An ID is required, but is assigned automatically. Change this if you want to refer to the shortcut menu in program code that you write.
Tip |
Although the examples shown here use both the initial underline to allow for translation and |
|
the ampersand to allow for keyboard entry, you don’t need to use these if you don’t want |
|
to. When was the last time that you used the keyboard to choose a menu item on a short- |
|
cut menu? |
1018 Part VI Customizing AutoCAD
You can create two kinds of context-sensitive menus: object menus and command menus. The context-sensitive menus work only for full menus.
Note If you’ve turned on time-sensitive right-clicking, remember to hold down the right mouse button long enough to open the shortcut menu. See Chapter 3 for details.
Object menus
The Edit mode shortcut menu appears when you right-click in the drawing area while one or more objects are selected but no command is active, as shown in Figure 33-11. Note that this menu includes the most common editing commands.
|
Figure 33-11: The Edit mode |
|
shortcut menu. |
|
You can create object menus that are specific to a type of object. You might want to add certain |
|
commands that you use often with that type of object. The commands that you add to an |
|
object menu are appended to the Edit mode shortcut menu so that the result is a menu that |
|
contains the Edit mode shortcut menu, plus any additional commands that you’ve added for |
|
that type of object. |
|
To create an object menu, you must assign the menu an alias of either OBJECT_objectname |
|
(used when one object of a type is selected) or OBJECTS_objectname (used when more than |
|
one object of a type is selected). The object name is the DXF name of the object. (The three |
|
exceptions are BLOCKREF for a block insertion with no attributes, ATTBLOCKREF for a block |
|
insertion with attributes, and XREF for an xref.) |
Tip |
To find out the object name of an object in AutoCAD, type the following on the command line: |
|
(cdr (assoc 0 (entget (car (entsel))))) |
Chapter 33 Customizing Menus 1019
That’s five closing parentheses at the end. AutoCAD then prompts you to select an object. As soon as you do, you see the object’s name on the command line. See Chapters 34 and 35, which cover AutoLISP and Visual LISP, for an explanation of the parts of this AutoLISP expression. AutoLISP is not available for AutoCAD LT. In AutoCAD LT, you can create a drawing with only the one object whose name you want to know, and save it as a DXF file. Scroll down to the ENTITIES section in the DXF file to find the object’s name. See Chapter 27 for more information about DXF files.
For example, to create an object menu that appears when one or more circles are selected, create an object shortcut menu with an alias of OBJECTS_CIRCLE. Open the Customize User Interface dialog box and look at the shortcut menus in acad.cui or aclt.cui for examples to help you create your own menus. Figure 33-12 shows the Hatch Object shortcut menu in the Customize User Interface dialog box with the one added command selected.
Figure 33-12: The Hatch Object shortcut menu adds one command,
HATCHEDIT, that appears when you right-click with a hatch selected.
Figure 33-13 shows how this shortcut menu appears when you select a hatch object. As you can see, the menu adds only one item, which executes the HATCHEDIT command.
1020 Part VI Customizing AutoCAD
Figure 33-13: The Hatch Object shortcut menu is like the Edit mode shortcut menu, but adds a Hatch Edit item that executes the HATCHEDIT command.
Command menus
The Command mode shortcut menu appears when you right-click in the drawing area while a command is active. You can create command menus that are specific to a command. The contents of the menu are appended to the Command mode shortcut menu; the result is a menu that contains the Command mode shortcut menu, plus any additional commands that you’ve added for that command. The default main customization file doesn’t include any specific command menus. To create a command menu, you must assign the menu an alias COMMAND_commandname, where commandname is any valid command, including any custom or third-party command. After you name the menu, you can add commands to it that you would like to have available in the middle of the command just by right-clicking. Here are a couple of possibilities:
For the LINE command, you might want to add the PLINE command to the shortcut menu, so that you can change your mind mid-command and create a polyline instead of a line. Of course, you can execute the PLINE command with one pick from the Draw toolbar, but the shortcut menu is closer.
For the ROTATE command, you might want to add the ALIGN command (available in AutoCAD only), in case you realize that you need to align an object instead of just rotating it. You can see this customized shortcut menu in Figure 33-14.
Figure 33-14: A custom command menu that appears when you right-click during the ROTATE command; the ALIGN command is at the bottom.
Chapter 33 Customizing Menus 1021
STEPS: Creating an Object Shortcut Menu
1.If you did the exercise on Customizing the Buttons Menu, open Windows Explorer and find ab1.cui. Right-click it and choose Copy. Right-click again and choose Paste. Rename the copy ab3.cui. If you have AutoCAD, also find ab1.mnl and rename it ab3.mnl. If you didn’t do that exercise, back up acad.cui or aclt.cui. Then use the method just described to make a copy of acad.cui or aclt.cui, and name it ab3.cui.
Note |
To find the location of your menu files, choose Tools Options and click the Files tab. Double- |
|
click Customization Files Main Customization File. |
Caution |
Don’t continue with this exercise without first completing Step 1. If you’re working on someone |
|
else’s computer, ask permission before doing this exercise. |
2.Open a drawing using any template. Type cuiload on the command line or in the dynamic input tooltip to open the Load/Unload Customizations dialog box. Choose ACAD and click Unload. Click Browse, browse to ab3.cui, and click Open. Click Load. When the file has finished loading, click Close to return to your drawing.
3.Type cui to open the Customize User Interface dialog box. The main customization file is listed as AB1 if you copied ab1.cui, or ACAD if you copied acad.cui. Right-click the customization file and choose Rename. Rename it AB3.
4.Double-click the Shortcut Menus item to expand it. Right-click Shortcut Menus and
choose New Shortcut Menu. The new menu appears, ready to be named. Type Table Object Menu .
5.In the Description text box of the Properties panel, type Context menu for Table object.
6.Click the Aliases text box and then click the Ellipsis button on the right. In the Aliases dialog box, click at the end of the current alias, and press Enter to start a new line. Type OBJECT_ACAD_TABLE. Click OK. Your Customize User Interface dialog box should look like Figure 33-15.
7.From the Command list, find the EXPLODE command and drag it to your new shortcut menu.
8.Click OK to close the Customize User Interface dialog box.
9.Choose Table from the Draw toolbar and click OK in the Table dialog box to create the default table. Pick an insertion point to place the table and click outside the Multiline Text Editor. Click the edge of the table to select it so that you can see that the table is one object. Deselect the table.
10.Select the table. Right-click and choose Explode from the shortcut menu. Click anywhere on the table to see that the table is now just a collection of lines.
Note |
If you have difficulty displaying the shortcut menu and you have Time-Sensitive Right-clicking |
|
turned on, you may have better results by turning it off. Choose Tools Options, click the |
|
User Preferences tab, and click the Right-Click Customization button. |
11.To return to your original menu, type cuiload. Unload ab3, browse to acad.cui or aclt.cui, and click Open. Click Load, and then click Close to return to your drawing.
1022 Part VI Customizing AutoCAD
Figure 33-15: The Table Object Menu, a shortcut menu, has two aliases and one command.
12.Draw a new table, select it, and right-click. You no longer have the Explode option. Press Esc. Do not save your drawing.
Creating Toggles on Drop-Down Menus
By examining acad.cui or aclt.cui, you can accomplish some interesting things with your menus, even if you don’t understand the code. You may have noticed that when the UCS icon is displayed, the View Display UCS Icon On menu item shows a checkmark. If you choose this item again, not only does the UCS icon disappear, but the checkmark does, too. This is called a toggle and is created using the DIESEL programming language, a language that enables you to customize the command line and that works only with text strings. However, you can use it for your own menus, even if you don’t know any DIESEL, simply by examining the code and making a few educated guesses. Here is the code:
$M=$(if,$(and,$(getvar,ucsicon),1),^C^C_ucsicon _off,
^C^C_ucsicon _on)
First, you see the UCSICON system variable mentioned in the expression (getvar,ucsicon). Then you see the two commands at the end that issue the UCSICON system variable and turn it off and on.
Chapter 33 Customizing Menus 1023
Perhaps you could use a similar example in your own menu. For example, when customizing AutoCAD, you often have to turn the FILEDIA system variable on and off. Perhaps you always forget whether it’s FILEDIA or DIAFILE and then have to look it up, and so you’d like to put it on your menu. First, create a custom command. For the label, you need to add some code like the following:
$(if,$(getvar,filedia),!.)FileDia
You can replace filedia with any system variable. The exclamation point (!) followed by a period marks the menu item with a checkmark. The text at the end is what displays on the menu.
For the command, you would use code similar to the following:
$M=$(if,$(and,$(getvar,filedia),1),^C^C_filedia 0,^C^C_filedia 1)
To use a different system variable, substitute it in the three places where filedia appears. If your system variable’s values are off and on, you need to use those instead of 0 and 1.
All you’ve done is substitute FILEDIA for UCSICON in two places and the new commands at the end (you use 0 and 1 for FILEDIA instead of off and on). You’ve also created the special label. It’s okay if you don’t understand the code — the point is that it works!
Customizing image-tile menus
Image-tile menus are menus that contain slides. The image tile displays the contents of the slides. The main use of image-tile menus is to insert blocks. You could use tool palettes in the same way, and tool palettes are easier to create. I cover slides in Chapter 30 and tool palettes in Chapter 26. AutoCAD LT doesn’t include any image-tile menus, but you can create them.
Figure 33-16 shows one of the image-tile menus in AutoCAD. You access this menu by choosing Draw Surfaces 3D Surfaces.
Figure 33-16: The 3D Objects image-tile menu creates the 3D Objects dialog box.
Figure 33-17 shows the Customize User Interface dialog box section for the 3D Objects imagetile menu.
1024 Part VI Customizing AutoCAD
Figure 33-17: The 3D Objects image-tile menu in the Customize User
Interface dialog box, with the Box slide selected.
Before you create your own image-tile menus, you need to create the slides. In order that they fit into the image tiles properly, you should create a floating viewport that is 3 units wide by 2 units high (or any multiple thereof, to maintain the proportion), center the drawing so that it takes up most of the viewport, and create the slide. Then create the slide library, as explained in Chapter 30.
To create a new image-tile menu, follow these steps:
1.Open the Customize User Interface dialog box.
2.Double-click the Legacy item in any menu to expand it.
3.Right-click the Image Tile Menus item and choose New Image Tile Menu.
4.Name the image-tile menu. The name will appear at the top of the dialog box.
5.Add a description if you want.
6.Add an alias. You will need to use this alias in the menu macro that displays the image-tile dialog box.
7.Either drag an existing command to the new image-tile menu, or create a custom command and drag that to the menu. (I explain how to create custom commands in the “Creating custom commands” section earlier in this chapter.)
8.In the Slide Library text box, enter the slide library name. The slide library is the name of the SLB file that contains the slides.
9.In the Slide Label text box, enter the label that you want to appear in the image-tile dialog box, which should also be the name of the slide (SLD) file.
Chapter 33 Customizing Menus 1025
As explained in the earlier section on menu swapping, you display an image-tile menu from another menu. For example, to display the 3D Objects menu, AutoCAD uses the following code in the Draw drop-down menu:
$I=ACAD.image_3dobjects $I=ACAD.*
This swaps to the 3D Objects image-tile menu and displays it. Remember that the customization name (ACAD in the previous example) is not necessary, if both the menu that you’re referring to and the menu that you’re placing the item on are the same. You can create a partial menu that displays an image-tile menu. Therefore, you need to add a menu item somewhere that displays your image-tile menu. For example, if your image tile menu’s alias is MyBlocks, you could use the following macro:
$I=MyBlocks $I=*
When you’re done, click OK to close the Customize User Interface dialog box. Choose the new menu item that references the image-tile menu, and the image-tile dialog box appears. AutoCAD or AutoCAD LT automatically creates the dialog box. If it has more than 20 items, AutoCAD or AutoCAD LT creates Previous and Next boxes as well. To use one of the images, choose it either from the listing or from the image tiles and click OK.
Figure 33-18 shows an image-tile menu that inserts the symbols shown.
Figure 33-18: An Image Tile dialog box created from an image-tile menu.
Customizing tablet menus
Tablet menus are straightforward, as shown in Figure 33-19. You can print out AutoCAD’s standard tablet drawing, AutoCAD 2006\Sample\Tablet.dwg or AutoCAD LT 2006\Sample\Table Overlay.dwg, and compare it to the Tablet Menus item in the Legacy section. The entire first section, Tablet Menu 1, is left blank for you to configure. Although this menu section lists
25 rows and 25 columns, to match Tablet.dwg, use 9 rows and 25 columns. If you configure this menu area (using the TABLET command) to contain 9 rows and 25 columns, you can place your own macro in each of these boxes.
Cross- |
For information on digitizing drawings and calibrating a tablet, see Chapter 16. |
Reference |
|
1026 Part VI Customizing AutoCAD
Tablet 1 |
Tablet 3 |
Tablet 2 |
Tablet 4 |
Figure 33-19: The standard digitizer Tablet menu and its four parts.
The syntax of the Tablet menu is very simple; you just need a name and the menu macro itself, although you can add a description.
Note If you customize the Tablet menu, don’t forget to also open Tablet.dwg (for AutoCAD) or Tablet Overlay.dwg (for AutoCAD LT). Make the corresponding changes, and print it out to overlay on your digitizer so that the drawing that you place on your tablet reflects the menu properly.
Working with the Screen menu
I don’t spend much time on the Screen menu here because it’s no longer used very much and will probably disappear in the not-too-distant future. If you’re interested in customizing it, click the Screen Menu item in the Legacy section and click the Learn More about Screen Menus link. AutoCAD LT doesn’t contain a Screen menu.
Creating keyboard shortcuts
The Keyboard Shortcuts section has two subsections. Shortcut keys are a way to speed up your work. You can add keyboard shortcuts for commands that you use often. Temporary override keys are keyboard combinations that affect commonly used drafting settings, such as object snap and ORTHO.
Chapter 33 Customizing Menus 1027
Tip |
To print a list of shortcut keys or temporary overrides, click either section and click the Print but- |
|
ton in the Shortcuts pane. You can also copy the list to the clipboard by clicking the Copy to |
|
Clipboard button. You can then paste the list into another document. |
Working with shortcut keys
You can create a keyboard shortcut for any command. Before adding a keyboard shortcut for a command, check to see that one doesn’t already exist. In the Customize User Interface dialog box, expand the Keyboard Shortcuts item, and then the Shortcut Keys section to see the current list. To create a new keyboard shortcut, follow these steps:
1.Open the Customize User Interface dialog box.
2.Expand the Keyboard Shortcuts item, and then the Shortcut Keys section.
3.From the Command List, drag a command to anywhere in the Shortcut Keys section. The location doesn’t matter.
4.In the Properties pane, click the Key(s) text box, and then click the Ellipsis button to the right to open the Shortcut Keys dialog box, as shown in Figure 33-20.
Figure 33-20: You assign shortcut keys to commands in the Shortcut Keys dialog box.
5.Click in the Press New Shortcut Key text box and press the keyboard combination that you want to use on your keyboard. Table 33-3 lists the keys that you can use to create shortcuts. When you include a modifier, such as Ctrl or Ctrl+Alt, with another key, you need to hold down the modifier or modifiers as you press the key. If the keyboard combination is already assigned to another command, then you see that command below the text box. If you want, you can choose another combination, or keep the one that you chose, thus overriding the original shortcut.
6.Click Assign. Click OK to close the dialog box.
7.Click OK to close the Customize User Interface dialog box. Try out your new keyboard shortcut!
Caution |
You should not reassign the commonly used Windows shortcuts, such as Ctrl+C (to copy |
|
data to the Clipboard), Ctrl+V (to paste data from the Clipboard), and so on. |
1028 Part VI Customizing AutoCAD
|
Table 33-3: Allowable Modifier and Key |
|
Combinations for Keyboard Shortcuts |
|
|
Modifier |
Key |
|
|
Ctrl |
Any letter, number, or function key |
Ctrl+Alt |
Any letter, number, or function key |
Shift+Ctrl |
Any letter, number, or function key |
Shift+Ctrl+Alt |
Any letter, number, or function key |
|
|
To remove a keyboard shortcut, right-click the shortcut in the Shortcut Keys section of the Customize User Interface dialog box and choose Delete. Confirm the deletion.
Working with temporary override keys
Temporary override keys are keyboard combinations that toggle drafting settings, such as OSNAP settings. AutoCAD and AutoCAD LT define most of these for you, which is helpful, because the required macros are complex. Most of them also have keyboard combinations, but several don’t, and you can easily add them. I explain how to use the existing temporary override keys in Chapter 4.
To see the current temporary override keys, open the Customize User Interface dialog box. In the Customizations In pane, double-click the Keyboard Shortcuts item, and then the Temporary Override Keys item. Click any individual temporary override to see its properties in the Properties pane. Keyboard combinations can include function keys, or the Shift key with any letter, number, or function key. Some of the temporary overrides have two or three keyboard combinations, one for the left hand, one for the right hand, and perhaps a function key.
To create a new temporary override key, follow these steps:
1.In the Customize User Interface dialog box, expand the Keyboard Shortcut item in the Customizations In pane.
2.Right-click the Temporary Override Keys item and choose New Temporary Override. Enter a new name for the temporary override. This name doesn’t have to be unique. In fact, if you want a temporary override to have two keyboard combinations, you need to create two temporary overrides with the same name and macro.
3.In the Properties pane, enter a description, if you want one. Enter a macro in the Macro 1 (Key Down) text box. You can also enter a second macro in the Macro 2 (Key Up) box, which is executed when the keyboard combination is released. Most temporary overrides don’t have a macro here; in this case, releasing the keys restores the settings prior to using the temporary override.
Tip |
To make a copy of an existing temporary override (in order to add a second key combination), |
|
copy the existing macro and paste it into the Macro 1 (Key Down) text box of your new tem- |
|
porary override. |
4.Click the Key(s) text box and then click the Ellipsis button. In the Shortcut Keys dialog box, click in the Press New Shortcut Key text box and press the keyboard combination that you want to use on your keyboard. The message below the text box indicates whether the keyboard combination is assigned. To accept the keyboard combination, click Assign, and then click OK.
Chapter 33 Customizing Menus 1029
You can now use your temporary override.
On the |
The file used in the following exercise on creating keyboard shortcuts, ab3.cui, is in the |
CD-ROM |
Results folder on the CD-ROM. |
STEPS: Creating Keyboard Shortcuts
1.Back up your menu files, if you have not already done so. (By default, these are acad.cui for AutoCAD and aclt.cui for AutoCAD LT.)
Caution |
Don’t continue this exercise until you’ve completed Step 1. If you’re working on someone |
|
else’s computer, ask permission before doing this exercise. |
2.To do this exercise, copy ab3.cui and rename it as ab4.cui. If you didn’t do the exercise “Creating an Object Shortcut Menu,” first copy ab3.cui from the Results folder of the CD-ROM to the default location for customization files. Right-click ab3.cui in Windows Explorer, and choose Copy from the shortcut menu. Right-click again and choose Paste. Rename the new file ab4.cui.
Note |
To find the location of your customization files, choose Tools Options and click the Files |
|
tab. Double-click Customization Files and Main Customization File to display the location of |
|
the menu files. |
3.Create a drawing using acad.dwt or aclt.dwt.
4.On the command line or in the dynamic input tooltip, type cuiload . In the Load/Unload Customizations dialog box, choose ACAD (or the currently loaded main customization file) and click Unload. Most of your menus and all of your toolbars disappear.
5.Click Browse. In the Select Customization File dialog box, choose ab4.cui and click Open. Back in the Load/Unload Customizations dialog box, click Load. All of your menus and toolbars reappear. Click Close to return to your drawing.
6.On the command line or in the dynamic input tooltip, type cui . In the Customizations
In pane of the Customize User Interface dialog box, right-click ACAD (or the previously loaded main customization file) and choose Rename. Type ab4 to change the customization name to match the file name.
7.In the Customizations In pane, double-click Keyboard Shortcuts and then Shortcut Keys to expand those items.
8.From the Command List, drag the Deselect All command to any location on the Shortcut Keys list.
Caution |
In the next few steps, you assign Ctrl+D, Ctrl+Shift+F12, and Shift+1 to commands. If these |
|
shortcuts are assigned on your system, try various combinations until you find an unassigned |
|
shortcut. |
9.In the Properties pane, click the Key(s) text box, and then click the Ellipsis button. In the Shortcut Keys dialog box, click the Press New Shortcut Key text box. On your keyboard, press Ctrl+D. Click Assign and click OK. (This command is equivalent to pressing the Esc key, but that can be hard to find without looking at the keyboard.)
