Through the Interface: Migrating your application to work with AutoCAD 2010

May 2015

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30


« Sometimes the best ideas are the simple ones | Main | The new APIs in AutoCAD 2010 - Part 1 »

February 11, 2009

Migrating your application to work with AutoCAD 2010

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

New compiler

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.

Installer update

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.


TrackBack URL for this entry:

Listed below are links to weblogs that reference Migrating your application to work with AutoCAD 2010:

blog comments powered by Disqus


10 Random Posts