Message 1 of 1
Toggle toolbars

Not applicable
10-05-2007
02:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this dummy code:
Public Sub test()
Dim currMenuGroup As AcadMenuGroup
Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("CSLUTILS_EN")
' Create the new toolbar
Dim newToolbar As AcadToolbar
Set newToolbar = currMenuGroup.Toolbars.Item("CSL Profiles")
If newToolbar.Visible Then
MsgBox "toolbar is visible"
Else
MsgBox "toolbar is hidden"
End If
End Sub
Now, what I really want is a checkable menu item that reflects the toolbars current visibility state and toggles it on or off. Now, in the CUI I know I can use some $(if,...) code because I examined the autocad CUI file for UCSICON.
But I don't know how to apply that principle to teh above macro code. How can I write a macro or something that is telling it to run the toolbar _show or the toolbar _hide
?
I know I can right-click in the toolbar area and choose toolbars, but I would still like to know.
Andrew
Public Sub test()
Dim currMenuGroup As AcadMenuGroup
Set currMenuGroup = ThisDrawing.Application.MenuGroups.Item("CSLUTILS_EN")
' Create the new toolbar
Dim newToolbar As AcadToolbar
Set newToolbar = currMenuGroup.Toolbars.Item("CSL Profiles")
If newToolbar.Visible Then
MsgBox "toolbar is visible"
Else
MsgBox "toolbar is hidden"
End If
End Sub
Now, what I really want is a checkable menu item that reflects the toolbars current visibility state and toggles it on or off. Now, in the CUI I know I can use some $(if,...) code because I examined the autocad CUI file for UCSICON.
But I don't know how to apply that principle to teh above macro code. How can I write a macro or something that is telling it to run the toolbar _show or the toolbar _hide
?
I know I can right-click in the toolbar area and choose toolbars, but I would still like to know.
Andrew