Jump to content

VB.NET not MENULOAD from Initialize


FELIXJM

Recommended Posts

The MENULOAD at startup does not work and shows ERROR. Already run the TESTE command Works.

 

 

Imports Autodesk.AutoCAD.Runtime  
Imports Autodesk.AutoCAD.ApplicationServices   
Imports Autodesk.AutoCAD.Interop   
Imports Autodesk.AutoCAD.EditorInput   
Imports System  
Namespace APPTESTENAME   
   Public Class Initialization   
       Implements IExtensionApplication   
       Public Sub Initialize() Implements IExtensionApplication.Initialize   
           MsgBox("START OK")   
           Try
                  Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument   
               Dim LINHA As String   
               LINHA = "(IF (NOT (MENUGROUP ""TOPOCAD2000"")) (PROGN(COMMAND ""_MENULOAD"" ""TOPOCAD2000"")(MENUCMD ""P15=+TOPOCAD2000.POP1""))(ALERT ""\nMENU ALREADY LOADED"") ) "
                 acDoc.SendStringToExecute(LINHA, True, False, False)
             Catch
                 MsgBox("ERRO")
             End Try
         End Sub
         Public Sub Terminate() Implements IExtensionApplication.Terminate
         End Sub
     End Class
     Public Class COMANDOS
         <CommandMethod("TESTE")> _
         Public Sub Teste()
             Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
             Dim LINHA As String
             LINHA = "(IF (NOT (MENUGROUP ""TOPOCAD2000"")) (PROGN(COMMAND ""_MENULOAD"" ""TOPOCAD2000"")(MENUCMD ""P15=+TOPOCAD2000.POP1""))(ALERT ""\nMENU ALREADY LOADED"") ) "
             acDoc.SendStringToExecute(LINHA, True, False, False)
         End Sub
     End Class
 End Namespace

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...