Valued Contributor
Posts: 86
Registered: ‎07-22-2006
Message 1 of 3 (88 Views)

Urgent:- How to create Submenu

88 Views, 2 Replies
11-30-2006 02:26 AM
Dear All,
Plz any body tell me how to create a submenu by using PopMenu class. I could not found any good tutorial to learn how to create menus and submenu. Some how i m able to create menu but could not found how to add submenu in it. I aslo want to set events on them and enable and disable the items.
Plz Urgent. thanks....
Valued Contributor
Posts: 67
Registered: ‎09-12-2006
Message 2 of 3 (88 Views)

Re: Urgent:- How to create Submenu

11-30-2006 04:13 AM in reply to: aslam
Here dimensionMenu points to the AcadPopupMenu representing the Dimension Menu.
The code adds a submenu (camSubMenu) and several menu entries into it. As for the events, you'll have to play with the items returned by the AddMenuItem methods.

AcadPopupMenu camSubMenu = dimensionMenu.AddSubMenu(dimensionMenu.Count, "CAM Dimensions");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Square", "SQUAREDIM ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Sphere Radius", "SPHERERADIUS ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Sphere Diameter", "SPHEREDIAMETER ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Key", "KEYDIM ");
camSubMenu.AddMenuItem(dimensionMenu.Count, "Leader", "LEADERDIM ");
Valued Contributor
Posts: 86
Registered: ‎07-22-2006
Message 3 of 3 (88 Views)

Re: Urgent:- How to create Submenu

12-01-2006 01:13 AM in reply to: aslam
Hi pavlos,
Very thanks for help. It is working. Now two more question plz help.

1. How to assign shortcut key to menuitems. like CTRL+SHIFT+T.
2. How to set image to menu item.
3. I tried to give a name like "Ho&spital". Here 's' should become the "Hot Key". But it did not work. Plz help.
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.