In this exercise, you will reference the .NET assemblies
AcCoreMgd.dll,
AcMgd.dll, and
AcDbMgd.dll. After you reference the three files, you will adjust the properties of the referenced files so they are not copied to the build output folder.
To reference the AutoCAD .NET API Files
- In Microsoft Visual Studio, click View menu Solution Explorer to display the Solution Explorer; if it is not already displayed.
- In the Solution Explorer, right-click the Dependencies node and click Add Project Reference.
- In the Reference Manager -
<project> dialog box, at the bottom of the dialog, click Browse.
- In the Select the Files to Reference dialog box, browse to one of the following locations:
- inc folder within the ObjectARX SDK that is supported for this release (recommended)
- Install folder of AutoCAD; default install location is
<drive>:\Program Files\Autodesk\AutoCAD <release>
- Select the
AcCoreMgd.dll file, then press and hold Ctrl, and select the
AcDbMgd.dll and
AcMgd.dll files. Click Add.
- Click OK.
- In the Solution Explorer, click the triangle to the left of the Dependencies node to expand it.
- Press and hold Ctrl, and select AcCoreMgd, AcDbMgd, and AcMdg from under the Dependencies node.
- Right-click over one of the selected references and click Properties.
- In the Properties window, click the Copy Local field and then select No from the drop-down list.
Note: Setting Copy Local to No instructs Microsoft Visual Studio to not include the referenced DLLs in the build output for the project. If the referenced DLLs are copied to the build output folder, it might cause unexpected results when the assembly file is loaded into AutoCAD.