How to check is AutoCAD is installed?

Discussion in 'AutoCAD' started by willemschwarte, Aug 6, 2003.

  1. Is there a way to check if AutoCad is installed?
     
    willemschwarte, Aug 6, 2003
    #1
  2. Are you trying to establish a connection to AutoCAD from another application? Here's how I connect to AutoCAD using Delphi:

    procedure ConnectToAcad(var Acad: AcadApplication); var   ErrorMessage: string; begin   try     Acad := IDispatch(GetActiveOleObject('AutoCAD.Application.15')) as       AcadApplication;     if not Acad.Visible then     begin       Acad.Visible := True;     end;   except     try       Acad := IDispatch(CreateOleObject('AutoCAD.Application.15')) as         AcadApplication;       Acad.Application.WindowState := acMax;       Acad.Visible := True;     except       ErrorMessage := 'Could not establish a connection to AutoCAD.';       MessageDlg(ErrorMessage, mtError, [mbOK], 0);       Exit;     end;   end; end;

    You could re-write this as a function that returns TRUE if a connection was established and FALSE if not.
     
    Mark_Abercrombie, Aug 6, 2003
    #2
  3. willemschwarte

    Ed Jobe Guest

    The method I use also tells me which vertical products are installed. I check the registry at:



    HKCU\Sofware\Autodesk\Autocad\R15.0



     



    The keys under this location are for the different vertical products, i.e. "Acad-2:409" is Map 4.5. The following function returns the path of an app or "" if its not installed.



     



    Function GetAdeskLocation(dt As Integer)



     



        'returns path of Autodesk desktop application.
        'You need to append a backslash to qualify path if desired
       
        'argument dt:
        ' 2 = Map 4.5
        ' 12 = Architectural Desktop 3
        ' 6 = Mechanical Desktop 5
        Dim strVal As String
        GetAdeskLocation = ReadRegVal(HKEY_LOCAL_MACHINE, "SOFTWARE\Autodesk\AutoCAD\R15.0\ACAD-" & dt & ":409", "AcadLocation", strVal)



     



    End Function




    --
    Ed
    --




    "Mark_Abercrombie" <> wrote in message news:...

    Are you trying to establish a connection to AutoCAD from another application? Here's how I connect to AutoCAD using Delphi:

    procedure ConnectToAcad(var Acad: AcadApplication); var   ErrorMessage: string; begin   try     Acad := IDispatch(GetActiveOleObject('AutoCAD.Application.15')) as       AcadApplication;     if not Acad.Visible then     begin       Acad.Visible := True;     end;   except     try       Acad := IDispatch(CreateOleObject('AutoCAD.Application.15')) as         AcadApplication;       Acad.Application.WindowState := acMax;       Acad.Visible := True;     except       ErrorMessage := 'Could not establish a connection to AutoCAD.';       MessageDlg(ErrorMessage, mtError, [mbOK], 0);       Exit;     end;   end; end;

    You could re-write this as a function that returns TRUE if a connection was established and FALSE if not.
     
    Ed Jobe, Aug 6, 2003
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.