AutoCAD Menus: Building a Menu Template, Part 3

July 15, 2003

This tutorial will show you how to add toolbars, toolbar
buttons, and flyouts to a menu file. Although AutoCAD provides
you with some useful features to define toolbars knowledge of
toolbar definition would be helpful for troubleshooting.

If you are not familiar with methods for defining toolbars,
toolbar buttons and flyouts please read the following tutorials
first:

Figure 2 -Click on image to
enlarge

The general syntax for defining a toolbar is as follows:[Toolbar ("toolbar-name", orient, visibility, x-loc,
y-loc, row)]

Where, "toolbar-name" refers to the name that appears on
toolbar title bar. The orient accepts floating, top,
bottom,
left, and right. The visibility accepts show and
hide. The x-loc
and y-loc specify the location of the toolbar in pixels and
accept integer values. The row specifies the number of rows for
the toolbar.

The general syntax for button definition is as follows:
[Button ("button-name", small-icon, big-icon)]macro

Where, "button-name" refers to the button tool-tip,
small-icon refers to the bitmap image that you use for the
button. You should create the image with BMP format. The image
size should be 16 by 15 pixels. For the big-icon you must use a
BMP image that its size is 32 by 30 pixels. If you use the image
of small-icon for big-icon AutoCAD will rescale the image for
big-icon. The macro is an ordinary menu option definition.

6. Save the file and load the partial menu in AutoCAD. The
toolbar appears on screen [Figure 3].

Note: If you have already loaded the menu in AutoCAD you should
unload it first. For loading and unloading partial menus read
the following tutorial:

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.