Public Sub createmenu() Dim menugroupobject As AcadMenuGroup Dim menuobject As AcadPopupMenu Dim submenuobject1 As AcadPopupMenu Dim submenuobject2 As AcadPopupMenu Dim menuitemobject As AcadPopupMenuItem Set menugroupobject = ThisDrawing.Application.MenuGroups.Item(0) On Error Resume Next Set menuobject = menugroupobject.Menus.Add("newdimensions") Set submenuobject1 = menuobject.AddSubMenu(0, "linear") Set submenuobject2 = menuobject.AddSubMenu(1, "angular") Set menuitemobject = submenuobject1.AddMenuItem(menuobject.Count + 1, "aligned", "-vbarun thisdrawing.aligneddimension" & vbCr) Set menuitemobject = submenuobject1.AddMenuItem(menuobject.Count + 1, "ordinate", "-vbarun thisdrawing.aordinatedimension" & vbCr) Set menuitemobject = submenuobject1.AddMenuItem(menuobject.Count + 1, "rotated", "-vbarun thisdrawing.rotatedimension" & vbCr) Set menuitemobject = submenuobject2.AddMenuItem(menuobject.Count + 1, "Angular", "-vbarun thisdrawing.angulardimension" & vbCr) Set menuitemobject = submenuobject2.AddMenuItem(menuobject.Count + 1, "diametric", "-vbarun thisdrawing.diametricdimension" & vbCr) Set menuitemobject = submenuobject2.AddMenuItem(menuobject.Count + 1, "radial", "-vbarun thisdrawing.radialdimension" & vbCr)
menuobject.InsertInMenuBar (ThisDrawing.Application.MenuBar.Count + 1)
End Sub
|