' 创建新的选择集
Dim sst As AcadSelectionSet
' 提示用户选择对象,
Set sst = ThisDrawing.SelectionSets.Add("aa")
' 提示用户选择对象,
Me.Hide
sst.SelectOnScreen
'---------------------------
sst.Delete
End Sub
就像这个代码中我没办法调用一个叫"dimadd"的模块,不知怎样在运行过程中点选右键菜单时调用模块:::
伤脑筋!!!
Dim currMenuGroup As AcadMenuGroup
Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)
' 创建新菜单
Dim newMenu As AcadPopupMenu
Set newMenu = currMenuGroup.Menus.Add("Menu")
' 向新菜单添加菜单项
Dim newMenuItem As AcadPopupMenuItem
Dim openMacro As String
' 给宏指定“ESC ESC _open”的 VBA 等价值
openMacro = "vbarun "
Set newMenuItem = newMenu.AddMenuItem _
(newMenu.Count + 1, "dimadd", openMacro)