GetInterfaceObject Version Problem

GetInterfaceObject Version Problem

Anonymous
Not applicable
439 Views
3 Replies
Message 1 of 4

GetInterfaceObject Version Problem

Anonymous
Not applicable
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
0 Likes
440 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
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
0 Likes
Message 3 of 4

Anonymous
Not applicable
you can apply this for your own needs, but you get the idea
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks Ledi

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

Regards
Sri
0 Likes