How to Create Customize Menu in AutoCAD

Written by:  • Edited by: Lamar Stonecypher
Updated Aug 16, 2010

You are working with AutoCAD continuously, bored with using repetitive commands? Then let’s create customized menus in AutoCAD. Believe me by using customized menus you can greatly improve your efficiency.

You of course may be very efficient but you might have observed that you are actually using some fixed sets of repetitive commands during your job. Using customized menu, you will not only increase your operational efficiency but also could increase your accuracy. Though it is possible to customize toolbox, buttons, icons everything but we will limit our discussion with customization of pull down menu.

Getting started

If you sometime feel that your AutoCAD menu bar is over crowded with number of menus or you want your menus to appear with some different order, then your task is very simple. Just go to tools>customize menus, you will see the menu customization dialogue box is opened, go to the menu bar. The lists of menus are displayed there; you can include, remove or change the order of the menu items from there.

Some basic of AutoCAD customize menu

When you are thinking to have something just beyond the changing orders of the menus or adding/removing some of them, you have to go for creating new menu. That’s what the topic of discussion of this article.

There are several types of menu file used by AutoCAD with the following extensions:

  • .mnu
  • .mnc
  • .mnr
  • .mns
  • .mnt
  • .mnl

Please don’t get scared with the list, we are not going to discuss about all of them. We should only know about .mns and .mnl as of now. .mns is the source menu file, autocad by default uses acad.mns for its default menu. You may see the acad.mns at \program files\autocad\support or wherever you have installed AutoCAD in your machine. Open the file using notepad you will be able to see the different sections of the file like below:

***MENUGROUP: you will define the name of your customize menu group, in acad.mns file it is ACAD.

***BUTTONSn: It controls the menus of your mouse.

***AUXn: It controls the menus of the system pointing device.

***POPn: This is what we are most interested about. It will control the appearance of your pull down menus. If you want to add some more pull down menus, then you have to create additional POP sections or else you can add some more options of one of the existing section, by adding additional codes.

***TOOLBARS: This section control the appearance of toolbars

***IMAGE: This section controls the image tile menu area.

***SCREEN: This section controls screen menu area.

***TABLETn: This section controls tablet menu area.

***HELPSTRINGS: This section controls the help string that will be displayed when a

cursor runs over any toolbar or highlights any menu.

***ACCELERATORS: This section controls the accelerator keys.

Our discussion will be centralized around the ***POPn section of .mns file for customizing pull down menus.

Example of creating a custom menu

We will discuss here how to create a menu named “HI” and the sublevel of the “HI” “conCir”, which will create two concentric circles of specified diameter.

We will place only the new menu “HI” in the whole drawing window, i.e, there won’t be any other icon and menus available when you will load this new menu file, though it may look like deviating from actual case but for the shake of understanding we will create such a special type of menu. Now go as below:

  • Create a new text file named newmenu.mns and save it to c:\program files\autocad\support (if you have installed your autocad in d drive then the path will change accordingly). Write the following codes to that file:

***MENUGROUP=ONS

***POP1

**HI

ID_HI [&Hi]

ID_CONC [conCir ](setq a (getpoint "locate center:"));\+

(setq b (getdist "enter the radius of smaller circle:"));\+

(setq c (getdist "enter radius of larger circle:"));\+

(command "circle" a b);+

(command "circle" a c);

  • Issue the command menu in autocad command section, the select menu file window will appear and from there you have to select the file newmenu.mns and click open.
  • You will see the menu HI appears at the top left corner of the autocad window, click on it you will find concir at the down level of it, click on it and provide the required inputs and you will get two concentric circles.

How the example codes works

First line of the code talk about the name of the new menu group, we have given a name ONS.

Second line tells that the new menu “HI” is a pull down menu and it is the first pull down menu (as we mentioned it as ***POP1).

Third line talks about the name of the pull down menu.

From the fourth line to the end of the codes are the actual codes for creating the concentric circles. Please notice that this is very much similar to autocodes lisp with some additions.

Meaning of some important symbols of the codes

; Means enter.

\ Means pauses for user input.

+ Indicates macros continue to the next line.


Comments

Showing all 2 comments
 
snehal Feb 1, 2011 11:04 AM
Plugin/Addin for AutoCAD
How to create addin component in autocad?
smita Feb 1, 2011 11:01 AM
Loading Project in menubar of AutoCAD
How to load ObjectARX project .arx file from our created menubar as like your above example?
which can be loaded using Appload command.
 
blog comments powered by Disqus
Email to a friend