FELIXJM Posted July 7, 2014 Share Posted July 7, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.