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.

  1. good,really make me excited!

  2. Does this mean that to develop in AutoCAD 2010 we require an upgrade to Visual Studio 2008 SP1?

    .NET Framework 3.0? 3.5?

  3. Not at all - you can continue to work with previous versions of Visual Studio (and the .NET Framework), although certain functionality requiring newer versions of the framework will not be available to you. At least that's my understanding.

    Kean

  4. Very prompt reply. Thanks.

  5. Another question. Having just downloaded AutoCAD 2010 from Product Downloads on subscription, where is the ObjectARX 2010. Do we have to wait for this?

    I referenced a few dlls in the application directly and was blown away by the additional features. It would help to get some pointers...

  6. ObjectARX 2010 is available now for Autodesk Developer Network members (from the ADN site), and should be available sometime this week from the public ObjectARX download site.

    Kean

  7. I have created an application in Visual Studio 2008 (it's not SP1) with C# and it worked perfectly with AutoCAD 2009. But, now, with 2010 I get this error:

    Application does not support just-in-time (JIT)
    debugging. See the end of this message for details.

    ************** Exception Text **************
    System.Exception: The component 'Autodesk.AutoCAD.AcInfoCenterConn.MyAutoCADBalloon' does not have a resource identified by the URI '/AcWindows;component/infocenteracconn/myautocadballoon.xaml'.

    ************** JIT Debugging **************
    Application does not support Windows Forms just-in-time (JIT)
    debugging. Contact the application author for more
    information.

    I referenced all necessary files in autocad 2010, and I don't understand what's the problem?

  8. Sorry - no idea...

    You might try submitting a sample project that reproduces the problem via ADN, if you're a member, or otherwise someone on the AutoCAD .NET Discussion Group might be able to help.

    Regards,

    Kean

  9. Thanks Kean for the reply. I'm not a member of ADN. I was wandering are the two assemblies AcInfoCenterConn.dll and AdInfoCenter.dll missing in AutoCAD 2010, or were they perhaps named differently? They contain the IExtensionApplication interface, which contains the methods Initialize() and Terminate() that you were explaining in one of the articles. It seems that this is the reason why I'm getting the error mentioned above. Thanks.

  10. Erm... you don't need either of these components to use Initialize()/Terminate().

    Are you actually using them for anything?

    Kean

  11. No. I do use Initialite() to load my customization .cuix file. I posted the problem yesterday on the forum if you care to take a look: discussion.autodesk....
    It's described more thoroughly.

  12. Stardust1611 Avatar

    I discovered what was causing this problem. I noticed I didn't set Copy Local to false on some of my references, and when I did that, the error disappeared. Thanks anyways.

  13. Can 2009 read a 2010 autodesk drawings aec objects?

  14. I'm afraid I don't know (but suspect not). You might try posting to the appropriate online discussion group.

    Kean

  15. Hi kean
    Iam entirely new to This functional area.Can yu tell me how to determine which of th lines form a polygon .[given five set of lines]

  16. This isn't a forum for support.

    Your comment doesn't appear to relate to this post, so please submit your question to the ADN team, if you're a member, or otherwise the AutoCAD .NET Discussion Group.

    Kean

  17. I am clear in logic but I cannot able to implement it.Reply me with the code.
    Thans in advance

  18. Please see my other replies. This blog is not a way to get support.

    If you continue to post such comments, I'll have no choice but to delete them from the site.

    Kean

  19. After overriding the subworlddraw, it is not getting triggerd??

  20. Sorry - I have no idea. Please post your code via ADN or to the AutoCAD .NET Discussion Group.

    Kean

  21. webfiaz@live.com Avatar

    hi,

    i want open auto cad 2010 file in may auto cad 2008, how it is possible? please help me.

    Xadi.

  22. Someone with AutoCAD 2010 or higher will need to save it back to AutoCAD 2007 (or previous) DWG.

    Please post any further such questions to our discussion group (this is not a support forum).

    Kean

Leave a Reply to Nithesh Cancel reply

Your email address will not be published. Required fields are marked *