Quick Start to AutoCAD 2000i / ADT 2.0i Custom Menus
Can be used on older versions of AutoCAD too

Contents:
Faking out AutoCAD ---- Adding a Custom Toolbar and Buttons ---- Fixing Errors and Recompiling

1Faking out AutoCAD
This trick comes by way of a frustrating day in class where I was running out of time and wanted to teach my class about custom buttons in such a way that my students could take their toolbars with them after class.

When you want to customize AutoCAD's menu, the best approach is to do the customization in a separate menu file because it will be easier to manage, keep for upgrades and take with you.   The problem is that making a custom menu file in AutoCAD is not as easy as making customizations to AutoCAD's menu.  Since most architectural design people want the as little to do with code as possible, I always look for ways to escape code; so here we go.

Use Notepad or equivalent to create the following file:

< leave completely blank >

Save as... " my_custom_menu.mnu " and save to C:\Program Files\AutoCAD 2000\Support or an equivalent location on the office Server or where ever your AutoCAD or AutoCAD flavor is stored.   The important elements here are that the file you make is blank, that you save it as a .mnu file and that you place it in a directory on AutoCAD's search path. 

custom_menu_notepad.gif (12005 bytes)
Compiling a custom menu in AutoCAD

In AutoCAD, type Menuload on the command line.  On the Menu Customization dialogue box, select the Menu Groups tab and pick on the Browse... button.

On Select Menu File dialogue box, set the Look in: path to the appropriate location to find the file we created above ( C:\Program Files\AutoCAD 2000\Support ) or your location.

On the Files of type drop-down list, select Menu Template (*.mnu) so that AutoCAD can see our menu file type.

Now, select the file we created ( "my_custom_menu.mnu" ) and pick the Open button.

Back on the Menu Customization dialogue box, you should now see you file in the File Name: text box.

Pick the Load button and you should now see your custom menu show up in the Menu Groups: list box.

You may get a dialogue alert about over-writing .mns files.   So long as you are not over-writing any of your other menus, pick Yes and continue.

Pick the Close button.

custom_menu_menuload.gif (24209 bytes)
2Adding a Custom Toolbar and Buttons
Creating a Toolbar

In AutoCAD "i" series, you can now type CUSTOMIZE to get to toolbar customization.  In older releases of AutoCAD and the "i" series, you can right-click over any button to access the customize option at the bottom of the toolbar pop-up menu.

From the Toolbars tab, use the New... button to create a new toolbar name.

We will allow AutoCAD to save our new toolbar in the default directory which should be ../support but could be somewhere else on a network server.  You may even have to set up a special custom folder for your private customized menus if you are on a corporate network.  If so, you'll need to path AutoCAD, see OPTIONS, so it will see this custom menu location.

custom_menu_toolbar.gif (18397 bytes)
A Blank Toolbar ready for Copied Buttons

Once you have created a new toolbar and picked the OK button, you should find a blank toolbar at about the upper middle of you screen.  Once you find it, you may want to drag it out, as illustrated to the right, so it is easier to see and work with.  

In AutoCAD 2000i there are some new button customization features, such as right-click to invoke a customization pop-up menu - see illustration.

For me, it has always been easiest to hold the Ctrl key down while dragging and dropping existing AutoCAD icons on to my custom toolbar; look for a little plus sign on the icon as you are dragging it and you know that you are making a copy of it and not moving it.

 

custom_menu_toolbar_copy_buttons.gif (19462 bytes)
To access all of the button icons in AutoCAD, you can pick on the Commands tab and pick by Categories; then, drag-n-drop from the right-side Commands list.  By using this approach, you don't have to worry about accidentally moving existing icons off the default AutoCAD menus.

On this tab, of the Customize dialogue box, you can also use the User defined Category to create your own single buttons and fly-out buttons which start out as blanks.

custom_menu_toolbar_drag_buttons.gif (21866 bytes)
3Fixing Errors and Recompiling

Making Sure Your Custom Menu Load Every Time

In most cases, I find that our little trick works but doesn't reload correctly when you re-launch AutoCAD.  The fix lies in the .mns or source code menu file that AutoCAD automatically compiled for us when we got it to load the .mnu file we created earlier (the blank file).

If you open the source file and remove the path statement from the ***MENUGROUP= statement, this should fix the problem.

Use Notepad or equivalent and look for my_custom_menu.mns in the same location as where you placed the original my_custom_menu_mnu file.

Highlight the C:\Program Files\AutoCAD\Support portion of the ***MENUGROUP= statement and delete it; it should simply read as:

***MENUGROUP=my_custom_menu

Save

Okay, so that was just a little bit of code but fairly easy to follow, right?

custom_menu_fix.gif (19600 bytes)
Reloading and Recompiling the menu

Now that we have made that little bit of a change to the source menu file, we have to get AutoCAD to recompile into a .mnc file ( a compiled menu file).  This part is easy since we have already gone through it once before when we converted a .mnu file to a .mns and .mnc file.

In AutoCAD, type Menuload on the command line.  On the Menu Customization dialogue box, select the Menu Groups tab and pick on the Browse... button.

On Select Menu File dialogue box, set the Look in: path to the appropriate location to find the file we created above ( C:\Program Files\AutoCAD 2000\Support ) or your location.

On the Files of type drop-down list, select Menu Template ( *.mns ) so that AutoCAD can see our menu file type. Make sure to set it to .mns and not .mnu

Now, select the file we created ( "my_custom_menu.mns" ) and pick the Open button.

Back on the Menu Customization dialogue box, you should now see you file in the File Name: text box.

Pick the Load button and you should now see your custom menu show up in the Menu Groups: list box.

Pick the Close button.

custom_menu_menuload_again.gif (16285 bytes)
Now shut AutoCAD down and re-launch it to see if your toolbar menu(s) reload.  If it doesn't, make sure it's listed in the Menuload dialogue box, check your Pathing in the OPTIONS dialogue box or talk to your CAD manager or IT person about how the regular AutoCAD menu is pathed and loaded.

If its working fine, like it should, keep on adding goodies to your custom menu.  Though I haven't covered it here, you can add your own buttons and even pull-down menus.

If you right-click over an unused portion of the toolbar area in AutoCAD, as illustrated to the right, you should now see your custom menu listed and any toolbars you have made.  Cool!

custom_menu_on-off.gif (5358 bytes)
For a Flash tutorial on AutoCAD R14 button making and designing see -> button movie

Copyright 2001 ARCHIdigm. All rights reserved.