.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Show/hide toolbars
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I loaded a partial customization file by CUI dialog. I would like to programmatically hide / show the menus and toolbars, so when you restart AutoCAD to be permanently hidden or visible. Can anyone hint how to do it?
Re: Show/hide toolbars
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi there,
this code works, but I have ran into problems when Windows 7 UAC is set to high:
If any one has a better way of doing this then I would be greatful also:
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Interop
Imports System.Environment
<Assembly: CommandClass(GetType(ToolbarCmds))>
Public Class ToolbarCmds
<CommandMethod("MyMenusCuix")> _
Public Sub LoadToolbars()
Dim cuiname As String = "MyMenus"
Dim cuifile As String = "C:\MyMenus.cuix"
Dim mg As AcadMenuGroup
Try
'Attempt to access our menugroup
mg = Application.MenuGroups.Item(cuiname)
Catch ex As System.Exception
'Failure simply means we need to load the CUI first
Application.MenuGroups.Load(cuifile)
mg = Application.MenuGroups.Item(cuiname)
'Cycle through the toobars, setting them to visible
Dim i As Integer
For i = 0 To mg.Toolbars.Count - 1
mg.Toolbars.Item(i).Visible = True
Next
End Try
End Sub
End Class
Regards,
Martin.
Re: Show/hide toolbars
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
...create/save two workspaces, one having your partial menues visible and the other workspace having them invisible ...?
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Show/hide toolbars
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you.
