I added the following references:
"AutoCAD 2015 Type Library"
"AutoCAD/ObjectDBX Common 20.0 Type Library"
But when I add the line:
using Autodesk.AutoCAD.Interop;
Interop is not available. What could I be missing?
Thanks & Regards
Solved! Go to Solution.
Solved by norman.yuan. Go to Solution.
To user AutoCAD COM API, you have 2 ways to set references to the COM libaries:
1. You can set references to the COM managed wrappers coming with ObjectARX SDK (primary interop assemlies provided by veders - Autodesk). With this interop assemblies, Autodesk defines the namespace Autodesk.AutoCAD.Interop, and Autodesk.AutoCAD.Interop.Common.
Prior to AutoCAD2013, AutoCAD installs the PIA into the GAC and updates Windows registry, so that the interop assembly references appear in VS's reference dialog's COM list.
2. However, since AutoCAD 2013, AutoCAD does not install the PIA into GAC any more. If you set reference in VS reference dialog->COM tab-> Acad typelibrary/Common type library, VS will use COM type library importing tool to create the managed interop assemblies for you, thus the namespace will be different. I guess this is what you did. If you look into the Object Browser, you would see that the name space is "AutoCAD" and "AXDBLib".
Norman Yuan