What To Do With The CUI - AutoCAD 2006
What To Do With The CUI - AutoCAD 2006
CP11-1 The Customize User Interface (CUI), introduced in AutoCAD 2006, radically changes how you
customize your environment. Along with the new dialog interface is the retirement of your .mns/.mnu
files. Workspaces affect the user's interface also. How do you use this new tool? All will be discussed
in this class.
Introduction
The new Customize User Interface is a radical
approach to customizing AutoCAD. Along with the
changes comes some confusion. This course is
intended not only to introduce how to use the CUI
Editor but to discuss the possibilities for organization
and migration issues.
Terminology
CUI (Customize User Interface)
1: The commands and elements, including workspaces, that makes
up the user’s interface.
2: The extension for the XML-based file that contains the
information used to present the user interface.
Main
The user customizable CUI file defined in the Options dialog box.
Enterprise
The CUI file defined in the Options dialog box that is not user
customizable.
Partial CUI
A CUI file that is loaded into the main or enterprise CUI file.
Core CUI
The CUI file that supports the application out of the box, e.g. Acad.cui.
Office CUI
A term used in this course to describe the CUI file that holds office standard customizations.
Nodes
Major sections of a CUI file, such as Toolbars or Mouse Buttons.
Service Packs and the CUI
Workspace
Do not even think about
Defines visible elements of the user interface and their location.
doing any CUI editing until
Commands you have the latest service
Macros that define an action and may be used throughout the nodes. pack installed.
2
What to Do with the New CUI
What files should be used for the main and enterprise CUI?
This is not an easy question to answer. The approach you take will depend on what you want to
accomplish and what is important to you. Do you want to “protect” the application’s files? Do you
have multiple vertical packages? Do you need to support multiple users? Do you have office
standards that should not be altered?
Of key importance is the fact that the enterprise CUI file, and any partial CUI files loaded into it,
are read-only to the user. Please note that although the CUI Editor makes the enterprise CUI file
read-only, all the user would need to do to be able to edit it is change their options. Therefore, you
still need to have network permissions assigned to protect the enterprise CUI file. You need to
provide a main CUI file, which means the user can modify it.
So let us start with the main CUI file first. You have the following options (not limited to):
You can start with a “blank” CUI file, performing a SaveAs on the Transfer tab.
Pros Cons
• You are starting with a clean slate • There is nothing there
• You have the non-transferable nodes, such as the Mouse
Buttons node
• New commands are created in easy-to-find file
You can start with the Custom.cui file, which is installed with AutoCAD
Pros Cons
• Custom.cui will always be there • The non-transferable nodes, such a the Mouse Buttons
node, are missing
• User customizations in Custom.mns can be migrated to
Custom.cui
• New commands are created in easy-to-remember file
3
What to Do with the New CUI
Do you need to be able to override some of the core CUI file such a shortcut menus?
Yes No
• Make it partial to the main or enterprise CUI file • Determine its location in the structure using other criteria
4
What to Do with the New CUI
Migration
The CUI file dialog boxes can be changed to show legacy menu files. You load the menu file and it
is converted into a CUI file. The CUI file will be used after the conversion, not the original menu
file.
You need to make sure the icons used by the legacy menu are found on AutoCAD’s search path
before you migrate the menu.
Migration of legacy files will work well if your menu files do not contain errors in them. One way to
reduce errors is to use the .mns file to perform the migration instead of the .mnu file. If a
migration fails, examine the source file for errors.
A very common error is to have an incorrect menu group name. The menu group name is not
intended to duplicate the filename of the menu. A menu group name is limited to 32 characters and
cannot contain spaces or punctuation marks.
Incorrect: ***MENUGROUP=C:\Acad Customizations\Menu\My Special Menu.mnu
Correct: ***MENUGROUP=MyMenu
You cannot have different CUI files with the same name (menu group name) loaded at the same
time. Another source of errors is to use the same ID for different menu macros.
Backup
Always save a backup of your CUI files before you edit them. I simply keep a zip file in the same
folder as the CUI files and drop the CUI files into the zip file before editing.
On occasion, you may find that you need to restore the original CUI files that were installed with
AutoCAD. The original CUI files are available in the C:\Program Files\AutoCAD
2006\UserDataCache\Support folder. UserDataCache is a hidden folder. There is no need to
reinstall AutoCAD simply to restore the original CUI files.
Create a workspace to store the interface so that you can retrieve it if needed. This will be covered
in more detail in the Workspaces section.
5
What to Do with the New CUI
Open the CUI Editor. Select the Partial CUI Files node. Browse to your Support folder and select the
Acad.cui file. The editor will display the Acad.cui file in the Customizations pane. Select the Main
CUI File in the drop down list. Expand the Partial CUI Files node to verify that Acad.cui is partial to
the main CUI file.
Close the CUI Editor. All of AutoCAD’s standard menus and toolbars will redisplay.
Standard Toolbars
Creating a new toolbar is as simple as right clicking on the Toolbars node and selecting New
Toolbar from the menu. The new toolbar is automatically given an element ID that cannot be
changed. Note that toolbars may have more than one alias. Aliases are useful for programs that
need to affect the display of the toolbar. However, as you will later see, workspaces dispense with
much of that effort.
6
What to Do with the New CUI
Flyout Toolbars/Buttons
The terms flyout toolbar and flyout button are essentially interchangeable,
however, newer documentation seem to use the term flyout toolbar more
often. This course will also use that term. This is because the item for the
flyout is represented as a nested toolbar. The nested toolbar is not a copy of
the source toolbar. Edits made to the nested toolbar are actually affecting
the source toolbar. Once again, these are not two separate toolbars. The
toolbar nested under another toolbar is simply a reference to the source
toolbar in the root of the Toolbar node.
There are two ways to create a flyout toolbar.
To create a flyout toolbar based on an existing toolbar you drag the source
toolbar into the desired location on an expanded toolbar.
You may also create a flyout and new source toolbar in one action.
Select an existing toolbar. Right-click and select New Flyout from Toolbar aliases
the menu. This will place a new toolbar both in the root of the Never change the initial alias
Toolbar node and within the selected toolbar. given the new source toolbar
for the flyout. If you do, the
A flyout toolbar has a unique property: Use Own Icon. This is how button on the toolbar where
you instruct the flyout either to use the icon of the last selected tool the flyout appears will not be
or always use the same icon. If you choose to use its own icon, note able to find that source
that the button preview of the icon does not update until you select toolbar.
image files. If you do not select image files, the icon will become
the “missing question mark” icon, regardless of what you see in the button image area.
If you change the icon for a flyout toolbar and only hit the Apply button, you can see the correct
icon displayed on the actual toolbar, if it is visible.
Pull-down Menus
Create a new pull-down menu by right clicking on the Menus node and selecting New Menu. Give
it a new name. Aliases are useful for control by programs.
7
What to Do with the New CUI
Shortcut Menus
Shortcut menus are a commonly edited feature. However, they can also be one of the trickiest
parts of the CUI editing and setup. If your main (or enterprise) CUI file does not have shortcut
menus then you need to copy all the shortcut menus to the main CUI file and “wake” AutoCAD to
the new additions. The Transfer tab makes this easy.
For example, assume you want to add a shortcut menu for line objects. Create a new shortcut
menu. Add the alias “OBJECT_LINE” to the new menu. This will cause the menu to be added to the
Edit menu when a line object is gripped. If you want the menu to appear when multiple lines are
selected use the alias “OBJECTS_LINE”. Add whatever commands you desire to the new menu.
If you test your changes at this point, they would not appear. AutoCAD is still using the original
context menus and will continue to do so even if you restart AutoCAD. To “wake” AutoCAD to the
new context menu you need to detach the Acad.cui file and test your changes. They should appear
at this time. Reattach the Acad.cui file and your edits will still be in effect.
8
What to Do with the New CUI
Keyboard Shortcuts
There are two types of keyboard shortcuts. The definitions in the
Accelerator section from a legacy menu are now called Shortcut
Keys. This is where you would make keystroke-based commands
such as defining F4 to use an OSnap such as EndP. Temporary
Override Keys are a new feature for AutoCAD 2006. For example,
you would use the Shift key during a command to temporarily toggle
Ortho.
Shortcut Keys
You need to use drag-and-drop
to add a new shortcut key. If
you right-click on the Keyboard
Shortcuts or Shortcut Keys
node and select New, shortcut
keys are not an option. However, to create a new shortcut
key all you need to do is drag-and-drop a command on to the
Shortcut Keys node. You then edit the Key(s) property to
assign a keystroke combination to the command. Take note
of whether the keystroke combination already exists.
At times, you want to overwrite the current definition of a
shortcut key. Remember that the last assignment of the
keystroke combination is the one that takes precedence.
Therefore, the CUI file that holds your overrides will need to
load after the CUI files that contain the original definitions.
This is an improvement over legacy menus, as the initial
definition was the one that took precedence. Depending on
the CUI file structure you have, you may decide to have a
separate CUI file for just shortcut keys!
There are a few keystroke combinations that you are unable to enter in the CUI Editor, e.g.
Ctrl+F1, Ctrl+F4, Ctrl+F6, and Ctrl+F10. However, a migrated .mns file with those accelerator keys
defined will import correctly. Import a temporary .mns file and transfer the definitions if you want
to make those definitions in the CUI Editor.
Mouse Buttons
Mouse buttons too are a drag-and-drop operation. Many of today’s mice sport more than two
buttons (not including the wheel). However, although the CUI Editor would seem to support more
than two buttons, you will find that those extra button assignments are ignored. Autodesk claims
9
What to Do with the New CUI
issues with the drivers for the mice. Whatever the real cause is, you are better off making
assignments to buttons with the mouse driver rather than the CUI Editor.
LISP Files
The .mnl files load automatically with the CUI file of the same name. However, you may also load
any LISP-based files along with the CUI file. This can reduce the number of autoload statements
you may have had in the .mnl file.
Legacy Elements
Some features of the user interface are being depreciated. These items are still supported by the
CUI Editor, but it is obvious that these elements may not be around forever. You may still need to
maintain these elements so the editor provides for this.
Tablet Menus
WinTab Drivers
Tablet menus will usually be migrated from a legacy menu into the Note that your tablet
CUI. However, it is still possible to create a tablet menu directly in the driver must be WinTab
CUI Editor. Tablet menu commands are added in the same manner as compliant. One source for
a WinTab driver is
the rest of the CUI customizations.
www.vtablet.com
Tablet Buttons
Tablet buttons assignments are made in the same manner as mouse buttons. If you are having
issues getting the buttons to work, be sure that the button has an alias assigned to it.
Screen Menus
If you are wondering what a screen menu is, this brief section does not apply to you. However,
there are those that do know what they are, and they have staunch supporters. Therefore, this
section is for those individuals.
Do not bother to continue using or maintaining screen menus. They are on their last legs. Note the
following warning in the Customization Guide for AutoCAD 2006.
I hate to be the bearer of bad tidings. The death of screen menus has been rumored for years.
Autodesk is well aware that there are firms and individuals that love to use screen menus. You may
have one that you are very fond of, and have put a lot of time into making it work.
However, dynamic blocks and tool palettes go a long way in addressing the functionality that will
be lost with the demise of screen menus. Now is the time to prepare. The effort will be worth it.
10
What to Do with the New CUI
Working with
Workspaces
Although you can
modify the CUI without
using workspaces, you must not ignore
them. At the very least, you should
create a workspace of your CUI as a
default. As you edit the CUI, it is far too
easy to alter the interface unintentionally
such as removing menus from the menu
bar. Migrating a legacy menu that used
menu swapping will display all the pull-
down menus on the menu bar, so a
workspace is needed to control the
visible menus. In addition, menus added
at later periods in time will often not
display automatically on the menu bar.
Therefore, you need to use workspaces
to manage those menus.
Workspaces may be stored in any CUI file, however, only the main and enterprise CUI file’s
workspaces are available. The enterprise CUI file is the perfect place to create workspaces that
need to be available on every user’s workstation.
Right click on the Workspaces node and select New Workspace. A new workspace has some
unfamiliar properties.
• Start On: This permits you to switch the active layout when you select the workspace.
• Model/Layout tabs: Choose to display or hide the layout tabs.
• Screen menus: Forget it. Lose screen menus.
• Scroll bars: Why does anyone use scroll bars when we have real-time pan/zooms?
Workspaces also control Dockable Windows, such as the Properties palette. Many of properties for
these windows can be set to “Do not change”. This is perfect in the case of workspaces assigned by
the enterprise CUI file. When you set the properties to that option the workspace will not change
11
What to Do with the New CUI
that property from what the user has set. It is a very good idea to dock toolbars that are controlled
by an enterprise workspace. If they are set to float, the user will get floating toolbars every time
that workspace is made active. In addition, floating toolbars depend on the resolution of the
screen, rather than the application window size.
Positioning and locking toolbars with both a main and enterprise CUI file is still problematic.
Note: If workspaces are only defined in the enterprise CUI file initially, there can be an error when
the user attempts to save their first workspace to the main CUI file. You have an option to avoid
the error: create the workspace in the CUI Editor.
You change the elements in
the workspace using the
Customize Workspace button
in the Workspace Contents
pane. The elements in the
pane turn blue. The elements
in the Customizations pane
display with check boxes.
Use those check boxes to
add elements to the
workspace. Change the
display order of the chosen
elements in the Workspace
Contents pane using drag-
and-drop.
The Workspace toolbar provides access to all your workspaces and
the general settings for workspaces (the left button). This toolbar
provides an excellent mechanism to switch the interface instead of
using a pull-down menu to swap other pull-down menus.
Bonus: There may be cases where you want a list of the workspaces
defined in a CUI file. Remember, a CUI file is simply an XML file. You
can use Microsoft’s XML interface to return a list of workspaces.
Private Function GetWorkspaces(CUIFilename As String) As Variant
Dim myXML As DOMDocument
Set myXML = New MSXML2.DOMDocument
myXML.Load CUIFilename
Dim myList As MSXML2.IXMLDOMNodeList
Set myList = myXML.getElementsByTagName("WorkspaceConfig")
Dim i As Long
For i = 0 To myCount
resList(i) = myList.Item(i).text
Next i
GetWorkspaces = resList
End Function
Conclusion
The CUI will make the actual customization process a matter of drag-and-drop, as long as you
understand how it works. “Do not over-think the CUI.” This course will help you use the CUI with
confidence.
12