GetInterfaceObject Version Problem

Discussion in 'AutoCAD' started by srinivasan, Jan 11, 2005.

  1. srinivasan

    srinivasan Guest

    Hello all

    I am using the objectdbx class to access the drawing data.
    I am using the syntax below which works fine in acad2000.
    Set dxbdoc =AcadApplication.GetInterfaceObject"ObjectDBX.AxDbDocument")

    But when i am using the same in Acad2004 it gives me an arror error in loading application.So i have to use the same in a modified form like the one given below
    Set dxbdoc =AcadApplication.GetInterfaceObject"ObjectDBX.AxDbDocument.16")

    which doesnt work in 2000.

    Can any one help me in finding a solution which will work in both the versions.Whether i have to check the version and load accordingly.

    Thanks in advance
    Regards
    Sri
     
    srinivasan, Jan 11, 2005
    #1
  2. srinivasan

    Ledi Guest

    try this:

    Select Case Mid(AutoCAD.Version, 1, 4)
    Case "16.1" '2005
    Set AcadMap = acad.GetInterfaceObject("AutoCADMap.Application")
    Case "16.0" '2004
    Set AcadMap = acad.GetInterfaceObject("AutoCADMap.Application.2")
    Case "15.0"
    Set AcadMap = acad.GetInterfaceObject("AutoCADMap.Application")
    Case Else
    Set AcadMap = acad.GetInterfaceObject("AutoCADMap.Application")
    End Select
     
    Ledi, Jan 11, 2005
    #2
  3. srinivasan

    Ledi Guest

    you can apply this for your own needs, but you get the idea
     
    Ledi, Jan 11, 2005
    #3
  4. srinivasan

    srinivasan Guest

    Thanks Ledi

    I had applied a similar method. I thought there could be some other direct methods to this.

    Regards
    Sri
     
    srinivasan, Jan 11, 2005
    #4
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.