.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiling C# Programs for different AutoCAD Versions ?

3 REPLIES 3
Reply
Message 1 of 4
kosak956
566 Views, 3 Replies

Compiling C# Programs for different AutoCAD Versions ?

Hi,
I am considering to compile diverse C# .NET programs / modules for different versions of AutoCAD, namely 2006 and 2007 .

1.
What is the best way to do it in Visual Studio .NEt 2005,
without having to switch the Project References acdbmgd.dll and acmgd.dll for the different AutoCAD versions and verticals ?

2.
How can I configure the naming sheme ?
For example :

AutoCAD 2006 DLLs compile to :

Module1_2006.dll
Module2_2006.dll........

AutoCAD 2007 DLLs compile to :

Module1_2007.dll
Module2_2007.dll........

I know
It's rather VS 2005 and not .NET API Know-How but there are so many AutoCAD .NET gurus out there...!!!

One could propably help ?????

Thanks in advance
Konstantin
3 REPLIES 3
Message 2 of 4
shambles
in reply to: kosak956

Konstantin

There are a couple of ways to handle this:

1. Use the tlbimp tool run against the AutoCAD type libraries to create your own interop assemblies and reference the generated assemblies from you app.

2. Use assembly re-directs either in the application configuration file or through the .Net Configuration console i.e. always compile against 2006 assemblies and use a re-direct when the app is deployed on a 2007 system.

I'm not sure how this pans out for 2006/2007, but we support 2004 - 2006 using the first method.

cheers
merv
Message 3 of 4
cgay
in reply to: kosak956

merv,

Your #1 approach is what I would recommend, but I couldn't figure out how it would work.

Let's say you use tlbimp to generate an interop assembly for 2006 and 2007.
I would assume you would give each a unique namespace. i.e. AutoDesk.AutoCAD.2006 and AutoDesk.AutoCAD.2007
If this were the case, how would you declare an object of a specific type (say AcadApplication) and expect this to compile?
AutoDesk.AutoCAD.2006.Interop.AcadApplication AcadApp;
AutoDesk.AutoCAD.2007.Interop.AcadApplication AcadApp;

They share no inheritance. How do you do it without writing separate functions for each specific version of AutoCAD?

C
Message 4 of 4
shambles
in reply to: kosak956

You only create an interop assembly using the 2006 typelibs - this means you cannot use new API features of 2007, but that's probably not going to be a big issue if you are supporting multiple versions. Like I say, I'm not sure how this pans out for 2006/2007, I'm assuming there have been no major changes to the typelibs. We have taken this approach using an interop assembly created against 2004 and it works for 2005 & 2006.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost