i make an autocad add on with dot net 3.50 and i reference to acdbmgd.dll,acmgd.dll from autocad 2012 what can I do to make it run on both autocad 2010 and autocad 2011 if i should reference to acdbmgd.dll,acmgd.dll from autocad 2010 where can i get this dll while i just have autocad 2012
4 Answers
I have had some success using 2008 libraries in AutoCAD 2010 so using the libraries from AutoCAD 2010 is probably your best bet, although not guaranteed to work. It will be depend on exactly what you are doing.
You can download the libraries as part of the ObjectARX 2010 package from Autodesk Developer Center (at the bottom of the page). You can also get ObjectARX 2011 from there if needed.

- 809
- 7
- 9
My best luck with longevity of AutoCAD Add-ons has been with AutoLISP. I have tools I wrote in 1995 that are still cooking strong now with no modification.

- 1,322
- 1
- 11
- 23
-
2(I can see( how (this would (stand the(test of time( but the )) brackets drive) me) nuts). ) ;) SYNTAX ERROR – CAD bloke Feb 16 '13 at 11:48
-
@CADbloke I couldn't control my laugh here. The first thing that made me turn away from LISP, was its syntax. By the way, have you tried to run the AutoCAD 2012 .net applications in the previous versions without recompiling. Using the normal API how back can we go using 2012 libraries. – Jatin Apr 30 '13 at 02:13
-
How AutoCAD copes with you .NET app depends totally on what parts of the API you use. They keep subtly changing it so you'll get a runtime error if you try to call a part of the API that is AWOL. The general consensus (inside my head) is to use earlier SDKs to target later versions. I compile numerous versions but butchering the csproj files. Also, post v2013 there is a another dll to reference for the core console classes so all the older stuff blows up. They split it up majorly. – CAD bloke Jul 09 '14 at 05:01
The .Net API is more compatible then the ActiveX ones, but there are still some differences.
You can always use Reflection to call the functions (call them by name), but there will be a bunch of checks to be done, and it will be a lot of work to have your app. react the same way on all versions.
Your best bet (what i would do at least) would be to make a wrapper class for each functionability you want. For example, I would create a "MyCircle" class to manipulate circles, and then, inside this class, make a generic function (ex.: "ChangeThickness(int newThickness)"), and do your reflection code in there, so you can control how the call is made depending on the versions of AutoCAD installed (for example to not call a specific function in a certain version of AutoCAD because it contains a bug). This will make an expandable layer that you will be able to re-use in all version of AutoCAD, and you will be able to support any changes in the API.

- 542
- 6
- 17
I do this for 2012 and 2013. There are some difference between them.
I generally start two project one with 2012 Acad.NET wizard and another with 2013 Acad .NET Wizard.
Update both simultaneously
Most cases its just copy paste some cases it will be different where in 2013 API have evolved for example in Civil3d 2012 there isnt any Co-Go point api where as in 2013 they have added that so in that case I need to change the code little bit to work in 2013.

- 480
- 5
- 10
-
Too hard to do manually without blowing it up. I wrote https://github.com/CADbloke/CodeLinker to keep things like that in sync. In any case, you are better off having one set of code files and using compiler directives to control the differences. – CAD bloke Oct 20 '16 at 11:38