Using 2011 objectarx with vs 2008 I noticed there are two ways to use interop.
1. Reference the COM libraries (AutoCAD 2011 and ObjectDBX 18)
2. Reference the .NET libraries (Autodesk.AutoCAD.Interop 18.1 and Autodesk.AutoCAD.Interop.Common 18.1)
Which is correct or preferred?
Solved! Go to Solution.
They're essentially the same. When you add a reference to a COM type library
in Visual Studio, it imports the type library and generates the 'TypeLibrary.Interop.dll'
assembly for you, in your project.
The '*.interop.dll' files it generates contain the managed wrappers for the COM
type library.
The only advantage of referencing the pre-built interop libraries directly is that
you can set CopyLocal to false, and eliminate the need for Visual Studio to
generate the wrappers for you, and not have them replicated in every project
where you use them.
have the autocad .net assemblies been added into the GAC on new version? Previously i've always had to browse to the dll in the program files folder when addding a reference....
I might be using the wrong terminology. Right now i'm developing for autocad 2010 using VS2008 express edition. On my 32-bit machine i can find both "AutoCAD 2010 Type Library" and "AutoCAD/ObjectDBX Common 18.0 Type Library" in the Add Reference....COM tab. On the 64-bit machine "AutoCAD 2010 Type Library" appears on the Add Reference....COM tab but i have to browse to "C:\Program Files\Common Files\Autodesk Shared\axdb18enu.tlb" to get ObjectDBX. Neither the 32-bit or 64-bit machines show any Autodesk.AutoCAD.Something assemblies in the Add Reference.....NET tab. Is this ithe case for everyone or are my installs just mucked up somehow?
-Chris