cad中创建下拉菜单和菜单项的VBA程序代码

更新时间:2024-03-21 22:37:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Visual basic 与AutoCAD二次开发298页 创建菜单

Sub InsertMenu()

Dim currMenuGroup As AcadMenuGroup

Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0) Dim newmenu As AcadPopupMenu

Set newmenu = currMenuGroup.Menus.Add(\磁选机设计\

Dim newmenuitem1 As AcadPopupMenuItem Dim newmenuitem2 As AcadPopupMenuItem

Dim openmacro1 As String Dim openmacro2 As String

openmacro1 = Chr(3) & Chr(3) & Chr(95) & \盘类零件\openmacro2 = Chr(3) & Chr(3) & Chr(95) & \轴类零件\

Set newmenuitem1 = newmenu.AddMenuItem(newmenu.Count + 1, \盘类零件\currMenuGroup.Menus.InsertMenuInMenuBar \磁选机设计\

Set newmenuitem2 = newmenu.AddMenuItem(newmenu.Count + 1, \轴类零件\currMenuGroup.Menus.InsertMenuInMenuBar \磁选机设计\

newmenu.InsertInMenuBar (ThisDrawing.Application.MenuBar.Count + 1) End Sub

本文来源:https://www.bwwdw.com/article/g6b8.html

Top