• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy
  • Bahasa Indonesia

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / Exploring AutoCAD CUI: Creating a command in tab (part 2)

Exploring AutoCAD CUI: Creating a command in tab (part 2)

February 20, 2012 by Edwin Prakoso 12 Comments

In this Article...

  • Change your active customization file
  • Create a new command
    • Configuring your command
  • Placing your command
    • Creating a panel
    • Creating a ribbon tab
    • The last thing: Define the workspace

In previous tutorial, we explore the CUI dialog interface and create our own customization file. Let’s go further.

Let’s see what we will do:

  1. We will use our own cui file. So create it first before you follow this tutorial. We did it on the last tutorial.
  2. We will create custom commands. Later, we will combine them with existing AutoCAD command  to our panel.
  3. We will create a panel and a ribbon tab.
  4. We will define in which workspace the panel should appear.

Change your active customization file

In your CUI dialog, select your custom CUI you created before. If you miss the first step, you can check it in this first tutorial. I named it CAD-NOTES, but you may use your own name.

active cui

You should see your cuix file here. The command list is still empty, and there is no toolbar, menu or ribbon defined yet.

Create a new command

Let’s try to create a ribbon panel version of Paul Munford’s killer macro. There are few default AutoCAD command, but we also need to create the commands. So I guess this is a good exercise.

First, we need to create a command. In command list area, click create a new command.

create new command

Now you should see a command is listed here. The default name is Command1. Notice that the source is CAD-NOTES. It means the command is defined in that file. Select it.

new command

The properties on the right pane is now showing the command’s properties.

Configuring your command

Change the properties as shown below:

custom command setting

Here are some considerations:

  1. You should give the command a unique name, so you can find it easily.
  2. You need to define the macro that will be executed when this command is active.
  3. Optionally, you may add information to description and other fields. You can also define the icon image. You can create 32×32 pixel image for large icon and 16×16 pixel for small icon. Or just pick one from available icons.

You may create as many tools as you want. In Paul’s article, you can find very useful custom tools. Read it, you may find some custom tools that you want.

But remember, if it’s already a default AutoCAD command, you can just use it. You don’t need to create a new one.

Placing your command

You already have your custom command. You can define it to execute macro like we did above, or run an AutoLISP program.

But you haven’t place it to a toolbar, menu or ribbon panel. AutoCAD doesn’t know where you want to place it. Yet. We must tell AutoCAD where it should be.

We’re still working on our custom CUI file. For this exercise, let’s work with ribbon. You may try to place it on menu or toolbar later, but this time just ribbon.

Where do you can find a command? In a ribbon panel. So now we must create a ribbon panel for our command.

Remember: If you decide to add this command to existing panel, you don’t need to create a new one.

Creating a panel

In customization tree, expand ribbon. You will see panels category there, but there is no panel defined yet. Remember, we are working on a new customization file.

Right click above the panels category and choose new panel from contextual menu.

create new panel

Give your panel a name. I named mine viewport tools.

Now we have a panel, but it’s still empty. How can I add my command to this panel? By drag it from command list and drop it under the panel.

drag command to panel

We will fine tune the appearance later. Just drag your command there now.

Creating a ribbon tab

Now AutoCAD knows on which panel the command should appear. But where the panel should be? Is it at home tab? annotation tab? We also need to define this.

Because we want to place all of our custom command to a separate tab, we need to create a new ribbon tab. Again, if you just want to add that panel to existing tab, you don’t have to create a new tab.

Right click above tab category, then choose new tab from context menu. Give the new tab a name.

Because we want our panel before to appear on this tab, drag that panel here.

placing panel to ribbon

The last thing: Define the workspace

Are we done yet? Unfortunately no. There is one last thing we have to define. In which workspace it should appear.

Follow these steps to place our tab to workspace ribbon.

  1. Change the customization file to ‘all customization files’ (1).
  2. Select drafting & annotation default (2). You should see the right pane is now showing the workspace contents (3).
  3. In customization files tree, expand partial customization files> your customization file> ribbon (4).
  4. Find your custom tab then drag it to ribbon tabs category.

placing tab to workspace

We are done! Click OK to accept all changes and close CUI dialog.

You should see your tab now. Click that tab to activate it. Your panel and command is now there!

custom ribbon tab appearance

If you don’t see it, make sure you use drafting and annotation workspace! You  can change it from quick access toolbar.

drafting and annotation workspace

Try the command to make sure it works.

Isn’t that cool? We will add more commands next, and how to arrange the commands in our panel.

About Edwin Prakoso

I work as a Sr. Consultant in PT Cipta Satria Informatika. I've been using AutoCAD since R14 and Revit since Revit Building 9. I occasionally write for AUGIWorld magazine and I am also active in Autodesk discussion forum. I'm a member of Autodesk Expert Elite, an appreciation for individuals who give contributions to the Autodesk community.
Connect with me on twitter or LinkedIn.

Filed Under: AutoCAD Tagged With: cui tutorial

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

12 Comments
Inline Feedbacks
View all comments
joel
joel
6 years ago

hello, i’m learning autocad arch and having a problem orienting 3d block to workspace. I found code for customizing command to use with netload but having trouble with finding a tutorial for implementing such a thing from start to finish for the first time. any help much appreciated

0
Reply
David Ding
David Ding
8 years ago

I wanted to load my “arg” file. however after I used “options” command, the screen doesnot load anything. I used a command before, but I forgot that command I used, it was similar to “appload”……but it’s not, Can you tell me what that command could be?

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  David Ding
8 years ago

Are you looking for MENULOAD command?

0
Reply
Adam
Adam
10 years ago

Great tutorials. I have created a partial CUIx and a custom command (in 2015 LT) but I would like to add it to an existing panel. Can you tell me how to do that. I don’t want an extra ribbon or panel.
Thanks

1
Reply
JJ717
JJ717
11 years ago

Are there any ways to activate these commands using the keyboard similarly to how i would press ”c” for ”circle”?

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  JJ717
11 years ago

Hi JJ717,

What you described is alias command. Certainly you can assign alias commands to your preference. Use command alias editor or edit acad.pgp directly.
Read about it here: Where Can I See AutoCAD Command Alias List?

1
Reply
Wojtool
Wojtool
Reply to  Edwin Prakoso
10 years ago

I crated a command and named it UZ.. I added it to a new menu and it works fine from there. But when I try to type “UZ” I have a message “Unknown command”.
How to make it work from the command line?

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  Wojtool
10 years ago

You can’t use command line to load custom command in CUI. If you want to use command line, you need to create custom command using LISP.

0
Reply
m4rtymcf1y
m4rtymcf1y
13 years ago

Hi there,i get as far as creating a new command but the command list is already full of many commands,are these just default commands and you`re just adding a few new user friendly tabs/panels?.Im using ACAD2011

0
Reply
Edwin Prakoso
Edwin Prakoso
Reply to  m4rtymcf1y
13 years ago

Hi Marty,

I use my own customization file (CUI). I explain it at the first paragraph. You can follow the previous tutorial to create it.

0
Reply
m4rtymcf1y
m4rtymcf1y
Reply to  Edwin Prakoso
13 years ago

Thanks Edwin,i was missing the `Load` screen,good stuff,
Mart.

0
Reply
As built Services
As built Services
Reply to  m4rtymcf1y
13 years ago

Thanks ! Great info!

0
Reply
wpdiscuz   wpDiscuz

Featured

Work Better with AutoCAD | Challenge 4 – Customization

In this 4th challenge to work better with AutoCAD, you will customize AutoCAD to allow you working faster.

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz