GetInterfaceObject Version Problem
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
GetInterfaceObject Version Problem

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
srinivasan
Guest





Posted: Tue Jan 11, 2005 10:06 am    Post subject: GetInterfaceObject Version Problem Reply with quote

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

Back to top
Ledi
Guest





Posted: Tue Jan 11, 2005 3:34 pm    Post subject: Re: GetInterfaceObject Version Problem Reply with quote

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
Back to top
Ledi
Guest





Posted: Tue Jan 11, 2005 3:36 pm    Post subject: Re: GetInterfaceObject Version Problem Reply with quote

you can apply this for your own needs, but you get the idea

Back to top
srinivasan
Guest





Posted: Tue Jan 11, 2005 5:44 pm    Post subject: Re: GetInterfaceObject Version Problem Reply with quote

Thanks Ledi

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

Regards
Sri
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB