The following tutorial shows you how to enhance menu macros
with the help of special characters and/or DIESEL expressions.
If you are not familiar with menu files read the following
tutorials first:
► AutoCAD Menus: The Base
Menu
► AutoCAD Menus: Partial
Menus
► Building a Menu
Template, Part 1
► Building a Menu
Template, Part 2
► Building a Menu
Template, Part 3
► Building a Menu
Template, Part 4
Note:
This tutorial is designed for AutoCAD 2004 though might be
applicable for other releases.
1. Download the
following files
►
sample.mnu
►
Singleln.bmp
2. Copy the files
to AutoCAD search path.
Note:
Refer to the following tutorial for more information on AutoCAD
search path:
► AutoCAD 2004
Customization Tutorial: Search Paths
3. Open sample.mnu
in Notepad.
4. Add some options
to the pull down menu [Figure 1].

Figure 1
Notes:
- ^ is equivalent to pressing Ctrl key. Therefore ^G means
press Ctrl+G and ^E is equivalent to pressing Ctrl+E.
- AutoCAD will not add Enter to those lines that end to
control characters.
5. Save the file
and load it as a partial menu.
Note:
To learn more about partial menus read the following tutorial:
► AutoCAD Menus: Partial
Menus
6. On Main menu
click Toggle Grid a few times and view the result [Figure 2].
Click Switch Isoplanes to change the current Isometric plane.

Figure 2
7. In Notepad make
some modifications to the sample.mnu [Figure 3].

Figure 3 - Click on image to
enlarge
Notes:
- !. puts a tick mark beside the menu option.
- ~ disables the menu option.
- $(getvar,isolines) will return the current value assigned
to the ISOLINES system variable.
- $(=, val1, val2) If val1 and val2 are equal the
string returns 1 otherwise 0.
- $(if,statement,then,else) If statement
returns a nonzero value then will be done otherwise
else will be used. The else action is optional.
8. Save the file.
9. From Main menu
select Reload Menu [Figure 4]. The menu will be reloaded
automatically.

Figure 4
10. Click Isolines
to view the latest changes [Figure 5].

Figure 5
Alireza Parsai is the founder of cadpanel.com. He is a
mechanical engineer with more than 12 years experience with
AutoCAD. Alireza is an Autodesk Authorized Author, the AutoCAD
consultant for Al Khawarizmi Institute, a contributing editor
for Augiworld magazine, a writer for CAD Digest, an instructor
for AUGI Training Program, and an elected speaker for Autodesk
University 2002. He has written 7 books in Farsi, 3 booklets in
English, and more than 30 articles for different magazines and
newsletters. You can reach him at
alireza.parsai@cadpanel.com or visit his website
www.cadpanel.com.