求助,关于菜单的问题
Public Sub qa()<BR>Dim currMenuGroup As AcadMenuGroup<BR>Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)<BR>Dim newMenu As AcadPopupMenu<BR>Set newMenu = currMenuGroup.Menus.Add("TestMenu51")Dim FileSubMenu As AcadPopupMenu<BR>Set FileSubMenu = newMenu.AddSubMenu("", "OpenFile")
Dim newMenuItem As AcadPopupMenuItem<BR>Dim openMacro As String<BR>openMacro = Chr(3) + Chr(3) + Chr(95) + "-VBARUN c:/aaa.dvb!" + Chr(32)
Set newMenuItem = FileSubMenu.AddMenuItem _<BR>(newMenu.Count + 1, "-VBARUN aaa", openMacro)
<BR>' 菜单条上显示菜单<BR>newMenu.InsertInMenuBar _<BR>(ThisDrawing.Application.MenuBar.Count + 1)<BR>End Sub<BR>以上程序运行后,AAA.dvb没有用,CAD命令行出行未找到宏.请帮忙! -VBARUN aaa这个是Label,是按钮上显示的标题。
Chr(3) + Chr(3) + Chr(95) + "-VBARUN c:/aaa.dvb!" + Chr(32)这个是宏,只有工程名称,缺少了没有模块名称和函数名称,
应该为:"-VBARUN 工程名称!模块名称.函数名称",注意工程要先加载。
页:
[1]