Active Contributor as
Active Contributor
41 Posts
0 Kudos
Registered: ‎04-27-2005
Post 1 of 1

Why doesn't the menu unload definitively

74 Views, 0 Replies
12-19-2005 10:30 PM
I have writen a routine that unloads a menugroup.

Code :
Friend Function UnLoad_Menu(ByVal MenuName As String) As Integer
Dim acadApp As AcadApplication
Dim acadDoc As AcadDocument
Dim curUCS As AcadUCS
Dim ReturnValue As Integer = 0

acadApp = CType(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, AcadApplication)
acadApp.Visible = True
acadDoc = acadApp.ActiveDocument
acadDoc.Application.Visible = True

Dim MenuGroepen As AcadMenuGroups
Dim MenuGroep As AcadMenuGroup
MenuGroepen = acadApp.MenuGroups
'MenuGroepen = acadDoc.Application.MenuGroups
MenuName = Mid(MenuName, InStrRev(MenuName, "\") + 1)

For Each MenuGroep In MenuGroepen
Dim MenuGroepNaam As String = Mid(MenuGroep.MenuFileName, InStrRev(MenuGroep.MenuFileName, "\") + 1)
If MenuGroepNaam.ToUpper = MenuName.ToUpper Then
ReturnValue = 1
End If

Return ReturnValue

Catch ex As Exception
MessageBox.Show("Unloading Toolbar" & vbCrLf & ex.ToString)
Return 2

End Try
End Function

If i run the routine it will unload the menugroup, and if you look ik the customize part it isnot there anymore. But when i restart Autocad it does come back until i unload it manualy. What is wrong, I can't find it out.

Can anybody help me. C# is not a problem to me, I can convert it.

With kind regards,

Harold van Aarsen
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!