Revit API
The programming interface for automating Revit and building add-ins.
Quick Answer
The Revit API is a .NET programming interface that lets developers read and modify Revit model data, run commands, and build add-ins that extend the software. Firms use it to automate repetitive modeling tasks, check model data, and export information, either directly in code or through tools built on top of it.
The Full Picture
Revit is Autodesk's BIM authoring software, and the Revit API is how developers extend it from the inside. Add-ins are typically written in C# or another .NET language, compiled into a library, and loaded by Revit through a manifest file. Once loaded, they appear as buttons on the ribbon or run in response to events.
The API exposes the building model as objects: elements, parameters, families, views, sheets, and relationships. Code can query these objects, for example to find every door missing a fire rating value, or change them, for example to populate a parameter. Changes to a model must be wrapped in transactions, and code must run in a valid API context supplied by Revit.
Many practitioners reach the API without writing a full add-in. Visual programming tools such as Dynamo and community tools such as pyRevit use it underneath, letting BIM staff automate tasks with graphs or scripts. Autodesk publishes the official SDK and developer documentation for each Revit version.
Add-ins are tied to Revit versions, so they often need to be recompiled or updated when a new release ships. The Revit API automates work inside a model; it does not by itself deliver a project, and results depend on the quality of the underlying model.
Real Examples
Common Misconceptions
People assume: The Revit API is the same as Autodesk Platform Services.
Actually: The Revit API automates the desktop Revit application on a user's machine. APS offers cloud web APIs, including Design Automation, which can run Revit in the cloud, but the two are separate interfaces.
People assume: Add-ins keep working across all Revit versions.
Actually: Add-ins are generally built against a specific Revit version and often need updates or recompiling when Autodesk releases a new one.
Frequently Asked Questions
What language is used for the Revit API?
The API is a .NET interface, and add-ins are most commonly written in C#. Other .NET languages work, and scripting tools such as Dynamo and pyRevit give access without compiled code.
Can I automate Revit without programming?
To a degree. Dynamo offers visual programming for common tasks, and many firms use pre-built add-ins. More complex or custom workflows usually need code against the API.
What is a Revit add-in?
An add-in is a program that Revit loads to add commands or behaviors. It registers through a manifest file and can add ribbon buttons or respond to events such as opening or saving a model.
Why must changes use transactions?
Revit requires model edits to be grouped in transactions so changes are applied as a unit and can be undone. Attempting to edit outside a transaction raises an error.