CCAD inc. Home Page - Experienced Drafting & Design Services, AutoCAD Training & AutoCAD Enhancements. AutoCAD Tips, Tricks and Shortcuts by CCAD inc.

AutoCAD Tips to Work Smarter - November 2003

Design AutoCAD Training Calendar AutoCAD Tips Acad Faqs
AutoLISP® Downloads About CCAD Contact CCAD Search

Customizing the Edit Right-Click Menu

AutoCAD 2000 introduced several context-sensitive right-click menus. These menus display different commands and options based on the location of your cursor and the active command when the right-click is executed. Two of the right-click menus you have probably used are the CmDefault and CmEdit menus.

CmDefault
Right-click in the drawing area and this menu displays when nothing is selected and no command is active.

CmEdit
Right-click in the drawing area when at least one object is selected, no grips are selected and no command is active.

You should already be familiar with creating pull down menu before attempting to create an Image menu. Click HERE to learn about pull down menus. You should also be familiar with the AutoCAD File Search Path and installing custom menus. Click HERE to read more about locating custom files.



You can customize these menus by editing the Acad.mnu or Acad.mns file. Note: The Acad.mns file stores all of the toolbar customizations you have made. I recommend that you make a copy of your current Acad.mns file in another folder before making changes.

The Acad.mnu and Acad.mns files are typically installed in the Support folder for AutoCAD.

Another option is to copy the Support files to a different folder and change the AutoCAD Support File Search Path To look for support files, like the Acad.mns file, in this location. This approach has the advantage of keep the original support files totally intact. For more information on this approach go to Profiles and Installing Menus.

2000

C:\Program Files\AutoCAD 2000\Support

2000i

C:\Program Files\AutoCAD 2000i\Support

2002

C:\Program Files\AutoCAD 2002\Support

2004

C:\Documents and Settings\XXXX\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\support\acad
where XXXX is your user name

You can customize the Acad.mns file using a text editor, like the Visual LISP Editor in AutoCAD. The Visual Lisp Editor can be started by selecting the menu path Tools > AutoLISP > Visual LISP Editor.

Open the Acad.mns file. Use the Find function to locate **CMDEFAULT in the file or scroll down until you locate the menu section below. This is the CmDefault section.

***POP502
**CMEDIT
[Context menu for edit mode]
ID_CMSelLast [&Repeat %s]^C^C;
[--]
ID_Cutclip [Cu&t]^C^C_cutclip
ID_Copyclip [&Copy]^C^C_copyclip
ID_Copybase [Copy with &Base Point]^C^C_copybase
ID_Pasteclip [&Paste]^C^C_pasteclip
ID_Pastebloc [Paste as Bloc&k]^C^C_pasteblock
ID_Pasteorig [Paste to Original Coor&dinates]^C^C_pasteorig
[--]
ID_Erase [&Erase]^C^C_erase
ID_Move [&Move]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_move,^C^C_move)
ID_Copy [Cop&y Selection]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_copy,^C^C_copy)
ID_Scale [Sca&le]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_scale,^C^C_scale)
ID_Rotate [R&otate]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_rotate,^C^C_rotate)
[--]
ID_Deselectall [Deselect &All]^C^C^P(ai_deselect) ^P
[--]
ID_Filter [&Quick Select...]^C^C_qselect
ID_TextFind [&Find...]^C^C_find
ID_Ai_propch [Propertie&s]^C^C_properties

Character(s)

Meaning

***

Menu Section

**

Submenu Name

ID_XXXXX

Reference to Helpstrings

[]

Label, text that appear in the menu

[--]

Divider in the menu

&

Next letter is underlined. Option can be selected by pressing ALT and the letter

'

The apostrophe makes the command transparent if supported by the command

^C

ESC or cancel

_

Language translator

;

Enter


Diesel Expressions

In addition to basic menu codes, Diesel (Direct Interpretively Evaluated String Expression Language) expressions can be included in menus. Each Diesel expression begins $M= followed by the Diesel expression. Arguments or options to the Diesel expressions are separated by commas.

$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_move,^C^C_move)

Here is a summary of the Diesel expression above. If the first four characters of the active command is GRIP, then enter the grip edit option MOVE, otherwise execute two ESC's and begin the MOVE command.

$(getvar,cmdnames) - retrieve the system variable cmdnames (active command name).
$(substr, $(getvar, cmdnames),1,4) - retrieve a portion of the text string beginning at the first character for a total of four characters.
$(eq,....,GRIP) - Is the portion of the text string GRIP?
$M=$(if,....,_move,^C^C_move) - If it is, input the text _move, if not ESC twice and begin the MOVE command.

I think it would be useful to include the Mirror and Array command in the CmEdit menu. Mirror is one of the Grip edit modes, so I copied the menu line for scale and made the appropriate changes. The Array command is not included in the Grip edit modes, so I copied the menu line for Erase and made the changes.

***POP502
**CMEDIT
[Context menu for edit mode]
ID_CMSelLast [&Repeat %s]^C^C;
[--]
ID_Cutclip [Cu&t]^C^C_cutclip
ID_Copyclip [&Copy]^C^C_copyclip
ID_Copybase [Copy with &Base Point]^C^C_copybase
ID_Pasteclip [&Paste]^C^C_pasteclip
ID_Pastebloc [Paste as Bloc&k]^C^C_pasteblock
ID_Pasteorig [Paste to Original Coor&dinates]^C^C_pasteorig
[--]
ID_Erase [&Erase]^C^C_erase
ID_Move [&Move]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_move,^C^C_move)
ID_Copy [Cop&y Selection]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_copy,^C^C_copy)
ID_Array [&Array]^C^C_array
ID_Mirror[M&irror]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_miror,^C^C_mirror)
ID_Scale [Sca&le]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_scale,^C^C_scale)
ID_Rotate [R&otate]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_rotate,^C^C_rotate)
[--]
ID_Deselectall [Deselect &All]^C^C^P(ai_deselect) ^P
[--]
ID_Filter [&Quick Select...]^C^C_qselect
ID_TextFind [&Find...]^C^C_find
ID_Ai_propch [Propertie&s]^C^C_properties

When you are finished making the changes, save the file and exit AutoCAD. Restart AutoCAD and the try out your new CmEdit menu. Note: If you load your Acad,mns using the Menu command you will uninstall any partial menus your may have loaded.