Editing Menugroup with VBA not effectuated in CUI

Editing Menugroup with VBA not effectuated in CUI

Anonymous
Not applicable
351 Views
1 Reply
Message 1 of 2

Editing Menugroup with VBA not effectuated in CUI

Anonymous
Not applicable
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
0 Likes
352 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Oh, I forgot to say,

The MenuGroup.Save statement doesn't affect on the cui file as this command doesn't work anymore in AutoCAD 2006, which I'm currently using
0 Likes