|
我用程序实现菜单的增加
Dim currMenuGroup As AcadMenuGroup
Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)
' Create the new menu
Dim newMenu As AcadPopupMenu
Set newMenu = currMenuGroup.Menus.Add("myMenu")
' Add a menu item to the new menu
Dim newMenuItem As AcadPopupMenuItem
Dim openMacro As String
' Assign the macro string the VB equivalent of "ESC ESC _open "
Macro = Chr(3) & Chr(3) & Chr(95) & "D:\程序\CAD二次开发\BOM.dvb!M1.InitializeEvents" & Chr(32)
Set newMenuItem = newMenu.AddMenuItem(newMenu.Count + 1, "open", Macro)
' Display the menu on the menu bar
currMenuGroup.Menus.InsertMenuInMenuBar "myMenu", ""
菜单增加正常,但是宏却运行不起来,怎么回事啊 |
|