.NET

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

Why doesn't the menu unload definitively

68 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

Try
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
MenuGroep.Unload()
ReturnValue = 1
End If
Next
acadDoc.Activate()
acadApp.Update()

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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.