This post looks at the basic steps required to prepare your application to work with AutoCAD 2010. I've copied the information from the recently-published Platform Technologies Customization Newsletter, a quarterly newsletter available to ADN members. A big thank you to Stephen Preston, Fenton Webb and Gopinath Taget for putting the material together.
AutoCAD 2010 software release marks the end of a binary compatibility cycle. Remember the migration from AutoCAD 2004/5/6 to AutoCAD 2007? Don’t worry – this time is a lot easier. And now you have another three years of compatibility to look forward to.
The major migration issues are:
- New compiler
- Function signature changes
- CUI and UI update
- Installer update
AutoCAD is now compiled using Visual Studio 2008 Service Pack 1. This is the only supported compiler for ObjectARX® 2010, and you will have to migrate your ObjectARX applications from Visual Studio 2005. If you’re using the ObjectARX Wizard, then all you have to do is load your project into Visual Studio 2008 and let the Migration Wizard do its thing. For other projects, you will also have to reference the new .lib files, which are now ‘18’ branded instead of ‘17’.
The compiler change should not have an effect on .NET applications, but you will need to reference the new AutoCAD managed assemblies (acmgd.dll and acdbmgd.dll).
Function signature changes
You’ll find a list of new, changed and removed functions in the ObjectARX Migration Guide. There are some changes for both ObjectARX and the .NET API.
The most significant change is to the member functions of classes derived from AcDbObject and AcDbEntity (i.e. custom objects), which were necessary to implement our new Overrule API [more on this in a coming post]. If you have a custom object/entity, you’ll get an error like this when you compile your code after running it through the migration wizard.
error C3248: 'AcGiDrawable::worldDraw': function declared as 'sealed' cannot be overridden by 'YourClass::worldDraw'
This is because many AcDbObject/AcDbEntity functions have changed their signatures (in a consistent way, you’ll be pleased to hear). Where you used to override the function as
public virtual foo(…)
you’ll now be using
protected virtual subFoo(…)
Likewise, if you want to call the base class implementation of the function from your derived class, you need to change the function name in the same way. For example a call to AcDbLine::worldDraw(…) would become AcDbLine::subWorldDraw(…)- otherwise AutoCAD will go into an infinite loop (and then crash).
CUI and UI Update
As part of our work to create a common look and feel between all Autodesk products, the structure of the AutoCAD Ribbon and AppMenu have changed significantly from the previous release. The MenuBrowser has been removed from the AppMenu, and so the API is no longer available. And the runtime RibbonBar API (AdWindows.dll) has been significantly refactored. Unfortunately this means that if you were adding RibbonBar elements at runtime in AutoCAD 2009, then you will have to rewrite that section of your application. The good news is that we have a new API for RibbonBar controls.
Whenever we break binary compatibility, we update AutoCAD’s major version number. This is how your installer can detect binary compatible release.
AutoCAD 2007 = R17.0
AutoCAD 2008 = R17.1
AutoCAD 2009 = R17.2
AutoCAD 2010 = R18.0
In the coming posts we'll look at the new APIs and developer documentation for AutoCAD 2010: the Overrule API, the Freeform Modeling API, the Parametric Drawing API, CUI API Enhancements, RibbonBar Controls, PDF Underlays and the new AutoCAD .NET Developer's Guide.