Sub ShHiToolbars() '显示或隐藏工具栏
'Dim Button As AcadToolbarItem
Dim Toolbar0 As AcadToolbar
Dim MenuGrout0 As AcadMenuGroup
'Dim SmallButtonName As String
'Dim LargeButtonName As String
'Dim ButtonType As String
Set MenuGrout0 = ThisDrawing.Application.MenuGroups.Item(0)
Set Toolbar0 = MenuGrout0.Toolbars.Item("测量剖面计算")
Toolbar0.Visible = Not Toolbar0.Visible = True
End Sub
显示或隐藏CAD所有工具条
Dim MenuGrout0 As AcadMenuGroup
Set MenuGrout0 = ThisDrawing.Application.MenuGroups.Item(0)
For i = 0 To MenuGrout0.Toolbars.Count - 1
MenuGrout0.Toolbars.Item(i).Visible = False '隐藏
'MenuGrout0.Toolbars.Item(i).Visible = True '显示
Next i
Dim curMenuGroup As AcadMenuGroup
Set curMenuGroup = ThisDrawing.Application.MenuGroups.Item(0)
Dim curMenu As AcadPopupMenu
Set curMenu = curMenuGroup.Menus.Item("计算标注(&J)")
Set menuItem = curMenu.Item("ID_分层计算面积")
menuItem.Enable = False
Set menuItem = curMenu.Item("ID_方量计算")
menuItem.Enable = False