Add Reference and Namespace

Add Reference and Namespace

VB.NET uses a process similar to C#. After you create the Hello World project, complete the following steps:

  1. Right-click the project name in the Solution Explorer to display a context menu.
  2. From the context menu, select Properties to open the Properties dialog box.
  3. In the Properties dialog box, click the References tab. A list of references and namespaces appears.

  4. Click the Add button to open the Add Reference dialog box.
  5. In the Add Reference dialog box, click the Browse tab. Locate the folder where Revit is installed and click the RevitAPI.dll. For example the installed folder location might be C:\Program Files\Autodesk\Revit Architecture 2012\Program\RevitAPI.dll.
  6. Click OK to add the reference and close the dialog box.
  7. Repeat steps above to add a reference to RevitAPIUI.dll, which is in the same folder as Revit API.dll.

    Figure 173: Add references and import Namespaces

  8. After adding the reference, you must import the namespaces used in the project. For this example, import the Autodesk.Revit.DB and Autodesk.Revit.UI namespaces.
  9. To complete the process, click RevitAPI in the Reference frame to highlight it. Set Copy Local to False in the property frame. Repeat for the RevitAPIUI.dll.