Message 1 of 2
Editing Menugroup with VBA not effectuated in CUI
Not applicable
06-08-2006
12:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
When I create a PopUpMenuItem in VBA in the menugroup "DIETER" (which is loaded as the main CUI-file), the PopUpMenu with its item shown in the menu bar, but not in the CUI Manager.
By consequence, when I restart AutoCAD, the popup menu has disappeared. I use the following code. Can anyone tell me what I'm doing wrong?
Private Sub TestCUI()
Dim MenuGroup As AcadMenuGroup
Dim Menu As AcadPopupMenu
Dim MenuItem As AcadPopupMenuItem
Set MenuGroup = Application.MenuGroups("DIETER")
Set Menu = MenuGroup.Menus.Add("Menu-test2")
Set MenuItem = Menu.AddMenuItem(1, "Itemtest", "^c^c-line")
Menu.InsertInMenuBar _
(ThisDrawing.Application.MenuBar.Count + 1)
MenuGroup.Save (acMenuFileCompiled)
End Sub
When I create a PopUpMenuItem in VBA in the menugroup "DIETER" (which is loaded as the main CUI-file), the PopUpMenu with its item shown in the menu bar, but not in the CUI Manager.
By consequence, when I restart AutoCAD, the popup menu has disappeared. I use the following code. Can anyone tell me what I'm doing wrong?
Private Sub TestCUI()
Dim MenuGroup As AcadMenuGroup
Dim Menu As AcadPopupMenu
Dim MenuItem As AcadPopupMenuItem
Set MenuGroup = Application.MenuGroups("DIETER")
Set Menu = MenuGroup.Menus.Add("Menu-test2")
Set MenuItem = Menu.AddMenuItem(1, "Itemtest", "^c^c-line")
Menu.InsertInMenuBar _
(ThisDrawing.Application.MenuBar.Count + 1)
MenuGroup.Save (acMenuFileCompiled)
End Sub