.NET

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

Why doesn't the menu unload definitively

65 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community