AutoCAD 2006 for CAD Managers, Part 2
8 Jun, 2005 By: Robert GreenIn the last issue of the CAD Manager's Newsletter, I began my coverage of AutoCAD 2006 with an overview of some new features I think CAD managers should know about. I also promised that I would begin examining the CUI (Customized User Interface) command and how you can use it to your advantage.
If you haven't had a chance to look at that issue, you might wish to do so now so you have proper context for this issue.
Customized User Interface — Menu Mechanics
One of the first things many CAD managers do when they customize AutoCAD is create customized pull-down and toolbar menus. In the past, the source for these menus was an MNU file. AutoCAD loaded the MNU file to generate further menu files with types MNS (menu source), MNR (menu resource) and MNC (compiled menu).
An additional AutoLISP file in MNL format could be included with the custom menu as well to facilitate loading AutoLISP routines that were required only by that menu environment.
In the new CUI environment, the lowly old MNU file has been replaced by a newer, slicker CUI file that is loaded using either the new CUI command or the old familiar Menu command that AutoCAD has supported for as long as I can remember. This is not to say that your old MNU code is dead, just that it has been superseded by something better. What makes the CUI file different from the old menu file is that it contains the following information, which is not stored in menu files:
Dockable window functions. Sheet Set Manager, Markup Set Manager, Tool Palettes and Design Center, to name the more prominent functions, may now be present with respect to wake-up state (on/off) as well as their transparency and float/dock states. These types of status items were always controlled globally via AutoCAD and did not change when a new menu was loaded.
LISP files. These may now be associated to the CUI file. The AutoLISP file doesn't actually become part of the CUI file, but rather is maintained like a pointer to an Xref. I'll examine the AutoLISP integration more later in this article.
Partial CUI files. Loading these files is very similar to loading additional MNS/MNU files in older releases of AutoCAD and using Menuload to juggle which submenus are on and off. Notable additions are now the ability to partially load related files such as AutoLISP code. Partial CUI files are now used to load Express Tools.
You can see graphical evidence of all these new capabilities in the CUI command dialog box (figure 1).
Loading MenusFigure 1. Custom User Interface dialog box is new to AutoCAD 2006.
Your old MNU files can be read using a slight change to the reliable Menu command. Use the Menu command to load an MNU file, which is now called a Legacy Menu Template (figure 2).
Once the MNU file is loaded, the new CUI command reflects the new menu structure in the current workspace you have selected (figure 3).
Figure 2. You can still use the Menu command to load old MNU files in AutoCAD 2006.
It's important to note that loading menu files is no longer just a matter of pointing to a menu file, but rather resetting an entire subsection of the workspace and CUI file the system uses.
In the interest of full disclosure, I have to admit that I'm still much more comfortable working with the good old MNU file in a text editor than I am rifling through a hundred or more right-click property screens. I will admit, however, that the ease with which you can now transfer and copy menu subsections between CUI files makes the migration of old menu sections and new ones much more pleasant for less-experienced programmers and those who've never used the old approach to edit files.
Customized User Interface — AutoLISP Mechanics
The CUI file maintains a pointer to any AutoLISP files you wish to load with the overall menu environment (figure 4). The AutoLISP file is maintained in the CUI file so that any time this CUI file is loaded, AutoCAD attempts to find the AutoLISP files using normal pathing parameters.
Figure 3. Loaded MNU files appear in the new Custom User Interface in your current workspace.
Probably the second thing many CAD managers do when they customize AutoCAD is use custom AutoLISP files to load in custom functions. In the past, we've had to keep track of which files we need or rely on the Appload function to maintain a list of the files we need to load. Although both these approaches worked, they offered no easy way to know which files were supposed to be loaded.
I can't stress enough that even with this new feature, the CAD manager is still responsible for keeping the AutoLISP files in a path that can be located, and that AutoCAD's new CUI mechanism will not prevent your users from tampering with or even deleting your files. All the old rules of file security still apply.
Give It a Try
My experience so far has been that an hour of poking around and using the Help documentation has made this learning process relatively painless. I hope that the starting point I've provided will give you a rapid start on working with CUI files.
Wrapping Up
Figure 4. Custom CUI files maintain pointers to all AutoLISP files that must load with them.
The best way to really get a good feel for the CUI interface is to jump in and give it a try. I recommend you start simple by building a new CUI file that includes a custom MNU file and some AutoLISP files you already use. You can then test to make sure the menus migrated as you expected, and that your LISP code loads properly.
In the next issue of the CAD Manager's Newsletter, I'll continue coverage of AutoCAD 2006's CUI functions and set the stage for the conclusion of the series, which will examine the new dynamic block capability. Until next time.
For Mold Designers! Cadalyst has an area of our site focused on technologies and resources specific to the mold design professional. Sponsored by Siemens NX. Visit the Equipped Mold Designer here!
For Architects! Cadalyst has an area of our site focused on technologies and resources specific to the building design professional. Sponsored by HP. Visit the Equipped Architect here!