.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to retrieve configuration inside eTransmit ?

5 REPLIES 5
Reply
Message 1 of 6
AubelecBE
544 Views, 5 Replies

How to retrieve configuration inside eTransmit ?

Hi another question on eTransmit.

 

when i do :

doc.SendStringToExecute("-etransmit" & vbCr & _
"CH" & vbCr & _
"archivage" & vbCr & _
"C" & vbCr & _
"" & Txt & vbCr , True, False, True)

 

i say to etransmit : use the configuration "archivage"

 

so the question : how i can check if the configuration already exist in etransmit ?

if i dont check it, my string is not good and i dont have the error for this. (asynchrone command).

 

 

thank

5 REPLIES 5
Message 2 of 6

I can see that you have another post, where you say that don't want to use the Etransmit API

 

Using the sendstring, you're limited to send command. Send -etransmit and select CH to select the configuration, then you can read the command line and see whats there, then decide.

 

Anyway, this is not very safe, I would say that the API is safer.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 6

I dnt want use interop.

I have to many pc with different system (seven 32b / 64b, xp) i have already use the command tlbimp.exe but for automatise this i need to have the exe for each system.

Message 4 of 6
Alfred.NESWADBA
in reply to: AubelecBE

Hi,

 

>> I dnt want use interop.

>> [...] i need to have the exe

If you control AutoCAD from an EXE, how do you do that without COM? The managed part is only available within DLL's loaded via _NETLOAD (or automatic loading techniques).

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 6
Alfred.NESWADBA
in reply to: AubelecBE

Hi,

 

and to be independent from specific versions of Interop or 32/64bit you can look to that samples from Hallex (others have sent a lot too, but he's the one I found most about that) for using Reflection to control via COM without referencing the Interop.DLL's

>>>sample1<<<

>>>sample2<<<

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 6 of 6
AubelecBE
in reply to: Alfred.NESWADBA

here my code for checking the DLL (example for PdfCreator.)

 

'*************************************************************************************
    '*** Fonction de Vérification des fichiers InterOp (ex : PDFCreator) *****************
    '*************************************************************************************
    '== Entrée :
    '==    NomProg  : Le nom du programme qui utilisera l'InterOp
    '==    NomApp   : Le nom + path de l'application à charger
    '==    NomDll   : Le nom du fichier (avec le .DLL) (qui doit exister à coté du prog)
    '
    '==    FichierDeBase32 : Le fichier qui doit générer la DLL. (Exe ou autre)
    '==    FichierDeBase64 : Le fichier qui doit générer la DLL. (Exe ou autre)
    '==    
    '==    
    '== Sortie
    '==    NomFichier : Le chemin complet + le nom.dll du programme compilé sinon retourne ""
    '==    
    '==    
    '*************************************************************************************
    Public Function VerifieInterOp(ByVal NomProg As String, _
                                   ByVal NomApp As String, _
                                   ByVal NomDll As String, _
                                   ByVal FichierDeBase32 As String, _
                                   ByVal FichierDeBase64 As String) As Boolean
        Dim OkRetour As Boolean = False


        Dim NomFichierInterOp As String = NomApp.Remove(NomApp.LastIndexOf(NomProg)) & NomDll


        If Not (IO.File.Exists(NomFichierInterOp)) Then

            Dim NomFichierTLPImp As String
            Dim NomFichierBaseDLL As String
            If IntPtr.Size > 4 Then
                '64 bits
                NomFichierTLPImp = "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\tlbimp.exe"
                NomFichierBaseDLL = FichierDeBase64
            Else
                '32bits
                NomFichierTLPImp = "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bin\tlbimp.exe"
                NomFichierBaseDLL = FichierDeBase32
            End If

            Dim RetourProcess As System.Diagnostics.Process

            Try
                MsgBox("Le programme va essayer de créer le lien avec le programme : " & vbCrLf & _
                       NomFichierBaseDLL & vbCrLf & _
                       "Une fenêtre va s'ouvrir et le programme va attendre sa fermeture.", _
                       vbOKOnly & vbCritical, "Information")

                Dim ParamTxt = """" & NomFichierBaseDLL & """" & " /out:" & """" & NomFichierInterOp & """"
                RetourProcess = Process.Start(NomFichierTLPImp, ParamTxt)
                Do While RetourProcess.HasExited = False
                    GestionAUTOCAD.EcrireSurLigneDeCommande(vbCrLf & "En attente du programme de lien...")
                Loop

                GestionAUTOCAD.EcrireSurLigneDeCommande(vbCrLf & "Fin du programme de lien, analyse du résultat.")
                If RetourProcess.ExitCode = 0 Then
                    'vérification si le fichier existe
                    If IO.File.Exists(NomFichierInterOp) = False Then
                        MsgBox("Le fichier " & NomFichierInterOp & " n'a pas été créé" & vbCrLf & _
                             "Contacter le responsable pour vérifier ce problème.", _
                                 vbOKOnly & vbCritical, "Erreur de Programmation")
                        GestionAUTOCAD.EcrireSurLigneDeCommande(vbCrLf & "Programme : " & NomFichierTLPImp)
                        GestionAUTOCAD.EcrireSurLigneDeCommande(vbCrLf & "Paramêtre : " & ParamTxt)
                        Return False
                    Else
                        Return True
                    End If
                End If
                Return False

            Catch ex As Exception
                MsgBox("Le programme de lien InterOP " & NomFichierTLPImp & "est introuvable." & vbCrLf & _
                       "Veuillez installer le SDK (Microsoft SDK)" & vbCrLf & _
                       "Contacter le responsable pour vérifier le bon répertoire." & vbCrLf & vbCrLf & _
                              "", vbOKOnly & vbCritical, "Erreur de Programmation")
                Return False
            End Try
        Else
            Return True
        End If

    End Function

 and use this code : example :

 

If VerifieInterOp("GestionFolio", Str, _
                                 "PdfCreator.dll",
                                 "C:\Program Files\PDFCreator\PDFCreator.exe", _
                                 "C:\Program Files (x86)\PDFCreator\PDFCreator.exe") = True Then
                Assembly.LoadFrom(Str)
                '--> Ajouter un espace à la fin de la commande
                Application.DocumentManager.MdiActiveDocument.SendStringToExecute(strCmd, True, False, True)
            Else
                MsgBox("Pour lancer le programme GestionFolio, il faut absolument" & vbCrLf & _
                       "installer PdfCreator dans le répertoire : " & vbCrLf & _
                       "C:\Program Files\PdfCreator\         (sous XP 32Bits / Seven 32Bits)" & vbCrLf & _
                       "C:\Program Files (x86)\PdfCreator\   (sous XP 64Bits / Seven 64Bits)", _
                       MsgBoxStyle.Information, "Erreur d'installation")
            End If

 but i need to know the exact path for the tlbimp.exe but if i have the SDK installed.

i cant have a file from earch system.

 

 

And for all your sample. i am not very good  in using interop and com and reflexion.

I make very simple code for my society.

And now i need to translate all my stuff from acad 2010 32b to acad2014 64b. for this i have to install VS2012 i think.

 

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost