Hallo,
falls es jemanden interessiert, hier der Code. Habe es dann doch noch hin gekriegt.
'*** Show Toolbar ***
Set oMenuGrp = AutoCAD.Application.MenuGroups.Item(menüname in Autocad)
Set oTBar = oMenuGrp.Toolbars.Item(toolbar)
oTBar.Visible = True
sTBarName = oTBar.Name
If oTBar.Visible = True Then
MsgBox "Toolbar: " + sTBarName + vbCr + "Status: Visible"
Else
MsgBox "Toolbar: " + sTBarName + vbCr + "Status: Hidden"
End If
'*** End Show toolbar ***
'*** Menü laden und Abrollmenü einfügen ***
mnunamenew = "mnupfad"
nochmal:
On Error GoTo neuladen
Set mgroupnew = AutoCAD.Application.MenuGroups.Load(mnunamenew)
On Error GoTo 0
'get the pulldown from the menu group
Dim newMenu As AcadPopupMenu
For int1 = 0 To mgroupnew.Menus.Count - 1
Debug.Print mgroupnew.Menus.Item(int1).Name
If mgroupnew.Menus.Item(int1).Name = pulldown Then
Set newMenu = mgroupnew.Menus(int1)
Exit For
End If
Next int1
'iterate through the menus in the menu bar to find the pulldown
For int2 = 0 To Application.MenuBar.Count - 1
If Application.MenuBar(int2).Name = inspulldown Then
' Exit the loop, just needed the number of the Pulldown
' menu, this will be the current value of int2
' Also need to know if the name of the popup menu was found
bTest = True
Exit For
End If
Next int2
newMenu.InsertInMenuBar int2
GoTo endes
'*** End Menü laden und Abrollmenü einfügen ***
'*** Menü entladen ***
neuladen:
Set mgroup = AutoCAD.Application.MenuGroups.Item(menüname in Autocad)
mgroup.Unload
GoTo nochmal
'*** End Menü entladen ***
------------------
cu
Heiko
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP