*2000/2002/2004*

Discussion in 'AutoCAD' started by Mike Tuersley, Jul 3, 2003.

  1. I've got both and everything works fine. Try connecting like this:

    Public Function StartAutoCAD(blnHide As Boolean) As Boolean
    '+--Fire up AutoCAD
    On Error Resume Next
    'Get the 2002 Application object
    Set g_cadApp = GetObject(, "AutoCAD.Application.15")
    'If error try connecting to 2004
    If Err Then
    Set g_cadApp = GetObject(, "AutoCAD.Application.16")
    'If error then create the object
    If Err Then
    Set g_cadApp = CreateObject("AutoCAD.Application")
    'Load AutoCAD invisibly
    g_cadApp.Visible = blnHide
    Do
    Err.Clear
    Resume
    Loop While Err.Number = 429
    End If
    End If
    'Set the AutoCAD document object
    Set g_cadDoc = g_cadApp.ActiveDocument
    End Function


    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jul 3, 2003
    #1
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.