Active Contributor as
Active Contributor
Posts: 41
Registered: ‎04-27-2005
Message 1 of 1 (72 Views)

Why doesn't the menu unload definitively

72 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.