Back

Destination Customization: Customized Solutions for AutoCAD

For a CAD manager, customizing software to better suit designers’ needs can be such an exciting task. I am often asked for creative solutions to get the product we manufacture to function properly in software so our customers can easily specify it and use it in hydronic heating and plumbing designs.

One of the customized solutions I configured in recent years for my company’s design team was an AutoCAD® MEP tool palette with pop-up menus. To do that, I learned how the Customize User Interface (CUI) Editor worked within AutoCAD. This article will show what I learned and, hopefully, inspire you to come up with your own customized solutions for your design team no matter what AutoCAD product you use.

The first thing to understand is that the CUI Editor is a very powerful tool within AutoCAD. There are many components within it that help make up the end user experience. Knowing this, you can roll out your company standards within this end user experience.

The CUI Editor can create and manage the following customization file types: Main, Enterprise, and Partial. For the purpose of this article, I will focus mainly on editing an Enterprise customization file that will roll out the customizations. To access the CUI Editor, simply type CUI in the command line (see Figure 1).

Figure 1:  CUI Editor overview

A.  This section displays CUIx files as well as a tree of all areas to customize. Figure 1 shows a Main CUIx file and an Enterprise read-only CUIx file loaded. If I want to edit the Enterprise file where all my customizations are, I need to designate it as the main CUIx in AutoCAD Options > Files > Customization Files as shown in Figure 1. In other words, I just browse out to the file in AutoCAD Options, so it becomes editable in the CUI Editor.
B.  This section lists all the commands. It allows out-of-box commands as well as custom commands. You can drag and drop these commands into all sorts of menus, toolbars, etc. as well as tool palettes outside of the CUI Editor. Note that you can only drag and drop the commands in the CUIx file that is      currently editable.
C.  This section includes all the properties associated with any given command in your command list. They may appear grayed out if they were created while your Enterprise file was being edited (which is the case in Figure 1). However, when the fields are not grayed out and that CUIx is editable, they can be  edited. When I create a “custom” command, I specify the following:

  • Name
  • Description
  • Command Display Name
  • Macro (what you want this command to do)
  • Image (you can pick existing ones or specify your own)

Now that we have an overview of the CUI Editor and its components, let’s look at how it affects the end user experience. See Figure 2 for an example of how the components in the CUI Editor make up the Build panel on the Home tab within the Piping workspace that is set as current in the Main MEP CUIx file. Note that the example shown is within AutoCAD MEP, but the same concepts still apply.

Understanding the CUI Editor will help you recognize patterns so you can create your own ribbon panels, menus, toolbars, or anything else to suit your designers’ needs. Recognizing patterns of what is already built will help you provide customized solutions much faster than starting from scratch.

Figure 2 shows how each tool or command is organized and grouped in the CUI Editor to appear a certain way in the ribbon. Commands are listed as stars; you can drag and drop from Section B to Section A and establish hierarchies of tools by right-clicking within Section A for different options (refer to Figure 1).

Sub-panels, rows, and line separators are just some of the tools that can organize the commands. Please keep in mind that your custom edits do not need to be this complex. This is simply an example of the power behind the CUI Editor.

Figure 2: CUI editing example

Let’s take it a step further and look at another way to customize the endduser experience using the CUI Editor and a tool palette. Tool palettes are influenced by multiple file types to properly display. While there are various file types that can influence the look and feel of a tool palette, I will focus on a few types to get the ball rolling.

The first type of file is for the tool palette itself (.atc). All created tool palettes generate an .atc file in AutoCAD Support Files > Palettes location, likely on your local drive. The second type of file is the tool palette group profile (.aws) that remembers all the tool palettes and the order of the tools within them. This is located in your AutoCAD Support Files > Profiles location.

The final major type of file is the master ATC file (.atc) that remembers all the tool palettes and all the tool palette groups. This file, which can vary by name depending on the AutoCAD product you are using, is located in the AutoCAD Support Files just outside of the actual Tool Palettes folder.

I don’t modify this file in any way, but I wanted to mention it as part of the hierarchy. Other file types such as images (.bmp, .png), block drawings (.dwg), and more can all be used within tool palettes once you establish those first few tool palette files.

Refer to AutoCAD Options > Files > Support File Search Path for a general path to these previously mentioned support files. Depending on your AutoCAD product, the exact folder names for tool palettes and other items may vary slightly after that point. When in doubt, refer to AutoCAD Options > Files to verify Tool Palette File Locations and more.

To create a tool palette for the first time, you must first go into AutoCAD Options to create a New Profile to set as current. This might seem like an extra step, but I do this because I want to make sure the file locations that are specified in AutoCAD Options for these new tool palettes are correct and that the files are generating properly as I go.

I’ve spent many hours wondering why my new tool palettes weren’t generating the .atc and .aws files, only to find out the file location I specified for these tool palettes didn’t have writing permissions to be able to automatically write there. I’m mentioning this to save you some of the potential frustration if you decide to change the Tool Palette File Locations in AutoCAD Options > Files to be something other than the out-of-box location.

Once you confirm your Tool Palette File Locations in AutoCAD Options, type TOOLPALETTES in the command line and right-click on the current palette to go to Customize Palettes where you can create a New Group and a New Palette (see Figure 3).

It’s important to name them right away because these tool palette files should now be generating in your AutoCAD Support files. Confirm that they are showing up in the locations you specified in the Tool Palette File Locations in AutoCAD Options. If you ultimately see .atc files and .aws folders named the way you intended in those locations, you are golden. Then the fun begins.

Figure 3:  New tool palette

At this point you may set this new tool palette group as current within the Customize Tool Palette window. From there you will have a blank slate where you can do any of the following:

  • Drag/drop drawing blocks to your tool palette.
  • Drag/drop commands from CUI, CONTENTBROWSER, or current drawing into your tool palette.
  • Configure macros in commands and add to your tool palette.
  • Add documents to buttons in your tool palette (i.e., User Manual or Company Standards) via the tool palette button properties.
  • Create custom images for your tool palette buttons.

For the purpose of this article, I will focus on command macros that ultimately create a pop-up menu within the tool palette. I did this for my company’s designers because we were utilizing many different routing preferences and systems for pipe drawing with our product within AutoCAD MEP. Even though this article will show that specific example, you can create macros and pop-up menus for any selection of commands you’d like to neatly organize in a tool palette.

One way to create a command macro is to hardcode one in within the CUI Editor. Be sure to use proper syntax and pay attention to the different options you already specified when using commands. You can find a table of proper syntax for macros when looking up the help files (F1) within AutoCAD itself.

See Figure 4 for an example of a command macro I created based on what I saw in the command line. I essentially specified that I wanted the PIPEADD command to engage, and then I specified the routing preference and the system I wanted the command to draw with.

These things I specified show up in the command line as highlighted letters, just like any other command that has options for you.  The whole purpose of macros is to help automate commands, so you don’t have to keep specifying and typing those commands out each time.

Figure 4: Creating a macro

Once you have written some macros in newly created commands within the CUI Editor, you can then drag and drop them from Section B to Section A under the Menus area (see Figure 5). You can use line separators to create a cleaner and more organized look within the menu as well.

Right-click to see your options. Once you build your menu, look at Section C to assign an alias for it. This alias will be used to call the menu in a DIESEL expression to ultimately make all those command macros pop up in the properties of a tool palette button.

Figure 5: Building a menu

Now it’s time to put it all together. To review, we created commands using macro syntax and placed them under a menu in the tree of customizable options in the CUI Editor. We then spelled out the alias of that menu so we could eventually put it in the tool palette to make that menu pop up with all those commands.

For the last step, we’ll specify the DIESEL expression that calls this menu in the tool palette. Go to a tool palette button on the tool palette itself and right-click to get into the Properties. Specify the highlighted settings in Figure 5 (and modify to suit your needs).

While DIESEL itself is a big topic all on its own, the point is that it is specifying a menu listed under a certain CUIx file. For my example in Figure 5, “Uponor” is an Enterprise CUIx file I made editable and “domesticcoldwater” is a menu I created in the CUI Editor with several different commands within it.

Type out the expression with characters and spaces as shown, and you will then have a pop-up menu in the properties of one tool palette button. See Figure 6 for a final result of building a tool palette, creating some command macros in the CUI Editor, putting those commands in a menu under an editable Enterprise CUIx file, and lastly, making that menu pop up in just one of the tool palette buttons.

Figure 6: Pop-up menu in the tool palette

As I mentioned in the beginning, customizing software to suit designer needs can be very exciting. Creating solutions for our designers has been very rewarding for me as a CAD administrator. My hope is that these brief examples will help you expand your horizons and inspire you to come up with ways to address the needs of your designers.

Before I wrap this up, I do want to mention that multiple files need to be carefully deployed so everyone can see these new tool palettes and other customizations. Please check out my article “Seven Songs about Scripts” in the July 2017 issue of AUGIWORLD magazine to read about ways to deploy these different files and customizations to your designers. Happy customizing!

Appears in these Categories

Back