AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA routines for multiple versions?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
290 Views, 4 Replies

VBA routines for multiple versions?

What's the best way to create VBA routines that will run on multiple versions of LD?

Is there a way to include multiple references in a dvb to avoid the user having to enter the IDE?

Thanks in advance.
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Don't use the references.....see the thread that Don Reichle started earlier
this month with the subjetc "Olde Current Surface-Alignment VBA code
problems". I posted an acad.dvb for him that does just what you are
asking.....the same acad.dvb works with LDD3 through LDD2007.

The best way I've found to code for this, so that the Intellisense works
while you're coding, is to use the reference for whatever version you have
open. Code, test, fix code, test, etc. until you are stisfied that it works.
Then remove the reference and change ALL variables Dim'ed as AEC.... objects
to Object. For intsance, in your original code you have this:

Dim oAeccApp As AeccApplication
Dim oSurf As AeccSurface

change these to be:
Dim oAeccApp As Object
Dim oSurf As Object

Test one more time to make sure you got all of them changed......and that
should do it.

Jeff

wrote in message news:5212896@discussion.autodesk.com...
What's the best way to create VBA routines that will run on multiple
versions of LD?

Is there a way to include multiple references in a dvb to avoid the user
having to enter the IDE?

Thanks in advance.
Message 3 of 5
Anonymous
in reply to: Anonymous

Jeff Mishler wrote:
> Don't use the references.....see the thread that Don Reichle started earlier
> this month with the subjetc "Olde Current Surface-Alignment VBA code
> problems". I posted an acad.dvb for him that does just what you are
> asking.....the same acad.dvb works with LDD3 through LDD2007.
>
> The best way I've found to code for this, so that the Intellisense works
> while you're coding, is to use the reference for whatever version you have
> open. Code, test, fix code, test, etc. until you are stisfied that it works.
> Then remove the reference and change ALL variables Dim'ed as AEC.... objects
> to Object. For intsance, in your original code you have this:
>
> Dim oAeccApp As AeccApplication
> Dim oSurf As AeccSurface
>
> change these to be:
> Dim oAeccApp As Object
> Dim oSurf As Object
>
> Test one more time to make sure you got all of them changed......and that
> should do it.
>
> Jeff
>
> wrote in message news:5212896@discussion.autodesk.com...
> What's the best way to create VBA routines that will run on multiple
> versions of LD?
>
> Is there a way to include multiple references in a dvb to avoid the user
> having to enter the IDE?
>
> Thanks in advance.
And other than a wrinkle produced by most-likely something on my PC,
Jeff's approach was working admirably saluki.

HTH


--
Don Reichle
"The only thing worse
than training your staff,
and having them leave is -
not training your staff,
and having them stay."
Courtesy Graphics Solution Providers
----------------------------------------------------------
!! Please discuss whatever we tell you with your SysMgr !!
!! They appreciate staying in the loop 🙂 !!

LDT/CD-2K4
AMD Athlon 64 X2 Dual 2.01GHz
XPPro 32bit SP2
2GB RAM
Dual WD800JD Hard Drives - 149GB Nvidia Stripe
Nvidia Quadro FX 1300 128MB
Dual ViewSonic 19-inch VA902b monitors
Message 4 of 5
Anonymous
in reply to: Anonymous

Hi,

Thank you Jeff. That is the clearest exposition of something which has
driven me mad for ages. I believe I now understand it.

Further aspects are that:

* sometimes Autodesk have made subtle modifications to the APIs between
versions and you should check thoroughly in each version to ensure that you
haven't invoked one of these situations.

* if your program performs very large quantities of computer intensive work
and is used regularly, then the slow down in the code operation will have to
be weighed against the convenience of one file.


--

Regards,


Laurie Comerford
www.cadapps.com.au


"Jeff Mishler" wrote in message
news:5212943@discussion.autodesk.com...
Don't use the references.....see the thread that Don Reichle started earlier
this month with the subjetc "Olde Current Surface-Alignment VBA code
problems". I posted an acad.dvb for him that does just what you are
asking.....the same acad.dvb works with LDD3 through LDD2007.

The best way I've found to code for this, so that the Intellisense works
while you're coding, is to use the reference for whatever version you have
open. Code, test, fix code, test, etc. until you are stisfied that it works.
Then remove the reference and change ALL variables Dim'ed as AEC.... objects
to Object. For intsance, in your original code you have this:

Dim oAeccApp As AeccApplication
Dim oSurf As AeccSurface

change these to be:
Dim oAeccApp As Object
Dim oSurf As Object

Test one more time to make sure you got all of them changed......and that
should do it.

Jeff

wrote in message news:5212896@discussion.autodesk.com...
What's the best way to create VBA routines that will run on multiple
versions of LD?

Is there a way to include multiple references in a dvb to avoid the user
having to enter the IDE?

Thanks in advance.
Message 5 of 5
Anonymous
in reply to: Anonymous

You're welcome Laurie.

You bring up some good points, and helped me to recall that there is one
very annoying problem with the API that I had to create a workaround for. I
haven't checked in 2006 & 2007 to see if this was corrected, but I doubt it.
The problem is with the
AeccDocument.Utility.XYtoEastNorth method

It just plain does not work with late binding. I posted the solution to the
thread "Late binding of AECCUtility" back in March of last year.


"Laurie Comerford" wrote in message
news:5213109@discussion.autodesk.com...
Hi,

Thank you Jeff. That is the clearest exposition of something which has
driven me mad for ages. I believe I now understand it.

Further aspects are that:

* sometimes Autodesk have made subtle modifications to the APIs between
versions and you should check thoroughly in each version to ensure that you
haven't invoked one of these situations.

* if your program performs very large quantities of computer intensive work
and is used regularly, then the slow down in the code operation will have to
be weighed against the convenience of one file.


--

Regards,


Laurie Comerford
www.cadapps.com.au

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report