As of AutoCAD 2013, we stopped registering AutoCAD COM Interop assemblies in the Global Assembly Cache (GAC). We continue to ship reference assemblies in the ObjectARX SDK.
The correct way to use these assemblies is follows:
- Reference the interop assemblies in your project from the ObjectARX SDK 2013 inc-win32 or inc-x64 folder, depending on whether you’re building a 32-bit or 64-bit plug-in. The two assemblies are Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common.
- By default in Visual Studio 2010, these are referenced with Copy Local = False, and Embed Interop Types = True:
- Erm. That’s all.
The ‘Embed Interop Types’ setting ensures the information required to access the ActiveX APIs you use in your code is embedded into your plug-in assembly. You don’t have to try to register the interop in the GAC, or ship the ObjectARX SDK reference assemblies with your plug-in, or create your own interop assemblies. If you’re migrating an older project instead of creating a new one, then you will have to check that ‘Embed Interop Types’ is set to true.
As an interesting aside, I was talking to Brian Ekins at the Manufacturing DevCamp and the conversation somehow drifted onto this topic. Turns out that it’s the other way around for Inventor: it causes problems for Inventor add-ins if you have ‘Embed Interop Types’ set to True – so you must set it to false for Inventor. We don’t create such differences between our products to confuse people, its just that they follow very different architectures and have completely different development teams. To coordinate to that level of granularity would surely cause every development team in the company to grind to a standstill .