Development Guide

BIM/Revit Plugin Development

Learn how to develop plugins for Revit using C# and .NET Framework with our comprehensive guide.

Getting Started with Revit Plugin Development

Developing plugins for Revit allows you to extend the functionality of the software and automate BIM processes. This guide will walk you through setting up your development environment and creating your first Revit plugin.

Important Note

This guide provides a general approach for Revit plugin development. Adjust paths and references based on your Revit version. Depending on the version of Revit you are using, you may need to choose the appropriate .NET Framework version.

1 Create the Project

  1. Open Visual Studio
  2. Create New Project
  3. Select Class Library (.NET Framework)
  4. Name it anything you want
  5. Click Create

2 Rename the Default Class

  1. Once the project loads
  2. Rename the default class file
    • Example: Class1.csMyRevitPlugin.cs
  3. Also rename the class name inside the file to match

3 Add Revit References

  1. Right-click ReferencesAdd Reference
  2. Browse to your Revit installation directory (typically):
    C:\Program Files\Autodesk\Revit YYYY
    (where YYYY is your Revit version year)
  3. Add these DLLs:
    • RevitAPI.dll
    • RevitAPIUI.dll
  4. Click OK
  5. Set copy local to false

4 Set Platform to x64

  1. From the top menu:
    Build → Configuration Manager
  2. Under Active Solution Platform:
    • Click New
    • Select or create x64
  3. Close Configuration Manager

5 Update Project Build Settings

  1. Right-click the projectProperties
  2. Go to Build
  3. Set:
    • Configuration: Debug
    • Platform: x64

6 Set Debugging Revit EXE

  1. In Project Properties
  2. Go to Debug
  3. Set Start external program:
    C:\Program Files\Autodesk\Revit YYYY\Revit.exe

Note: Plugin Installation

Sometimes Revit may not load plugins automatically. You might need to properly install them in the correct directory.

To Test the Plugin:

  1. Build the project
  2. Create a .addin manifest file in the appropriate Revit addins folder:
    C:\Users\[Username]\AppData\Roaming\Autodesk\Revit\Addins\YYYY\
  3. The .addin file should reference your compiled DLL
  4. Restart Revit to load the plugin
  5. You can try to add the following command in post-build (Properties → Build Event → Post-build). [Need to run VS as administrator to use this method]
    xcopy /Y /R "$(TargetPath)" "C:\Users\[Username]\AppData\Roaming\Autodesk\Revit\Addins\YYYY\"

💡 Tip: Sometimes you might need to properly install the plugin in the correct directory for Revit to load it.

✅ Final Reminders

  • Platform must be x64
  • References must match Revit version
  • Plugin must be installed in the correct addins folder
  • Revit needs to be restarted after installation

Sample Code

using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorldRevit
{
    [Transaction(TransactionMode.ReadOnly)]
    public class HelloWorldCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication uiApp = commandData.Application;
            UIDocument uidoc = uiApp.ActiveUIDocument;
            Document doc = uidoc.Document;

            TaskDialog.Show("Hello", "Hello World from Revit!");

            return Result.Succeeded;
        }
    }
}

This sample code creates a basic Revit command that shows a message dialog when executed.

Need Help with Plugin Development?

Professional CAD/BIM plugin development services to accelerate your automation goals.