Getting Started with the Revit 2012 API

We already published 'Getting Started with the Revit API' guides for Revit 2009 and 2010. Here is a completely revamped and much expanded version for Revit 2012. Actually, before even reading any further on this page, go to the Revit Developer Center and see what material is available there. That is always the most up-to-date place to look. Still, this overview may help your orientation as well:

  1. Setting up the Environment
  2. Where to Start
  3. For More Information
  4. .NET and C# Tutorials and Books

Getting Started with the Revit 2012 API

1. Setting up the Environment

The first step is to obtain and set up a development environment. This includes the Revit product itself, the Revit API, the Revit SDK (Software Developer Kit), and the development environment.

Revit Product: You can download the latest version of released products from the Autodesk product page. Go to www.autodesk.com, look under the 'Products' menu, 'Alphabetically.' From each Revit product page, look under Product Download. Following are examples of the links at the time of writing (Note: exact link may change):

Without an activation code, you can use Revit in viewing-only mode.

Revit API: The Revit API is provided by the .NET assemblies RevitAPI.dll and RevitAPIUI.dll, which are present in every Revit installation under

<Revit install>\Program

Revit SDK: The Revit SDK is included in every Revit installation.

The SDK installation can be launched from the 'Install Tools and Utilities' menu on the main page of the Revit installer. There is another menu called 'Utilities' you see right after the product installation, which contains only the link 'Content Batch Utilities'. Click on the 'Back to First Page' button to move back to the main page of the installer to install the SDK.

Alternatively, you can also find the SDK in the extraction folder, under:

<extraction folder>\support\SDK\RevitSDK.exe

If you have accepted the default location, it typically looks like this:

C:\Program Files\Autodesk\Revit XXX 2012\support\SDK\RevitSDK.exe

Note that the SDK may be updated by intermediate releases. Make sure you check for the latest version either on the members-only ADN site or the public Revit Developer Center.

The SDK includes Revit API documentation. The most important items are the Revit API help file RevitAPI.chm and the developer guide "Revit 2012 API Developer Guide.pdf". It also includes many samples.

Development Environment: Microsoft Visual Studio (MSVS) 2010 for Revit 2012. You may also use VS 2008 + SP1, but debugging a Revit 2012 add-in does not work in that environment. All the SDK samples are provided for VS 2010. The Visual Studio Express editions can also be used.

2. Where to Start

(1) Watch the training video – The best way to start is to watch our DevTV recording, posted towards the bottom on the Revit Developer Center.

If you are new to programming in general as well, take a look at the My First Revit Plug-in training material.

You can also have a look at last year's Revit 2011 API webcast recording.

It covers the basics of the Revit API since 2011. Note that the Revit API underwent a major renovation in 2011. The webcast materials include the recording itself, the Powerpoint presentation, and training labs code. You can also find it on the ADN web site, under the Revit knowledgebase section, or from the Developer Center Training Course Schedule and Webcast Archive.

The latest training labs for Revit 2012 are posted on the Revit Developer Center.

This year's Revit 2012 API webcast covers several major API enhancements.

If you are interested in Family API, there is a Revit Family API webcast recording, too.

(2) Work through the latest hands-on training labs, which are available from the Revit Developer Center (scroll down toward the bottom).

(3) Try implementing and running the HelloRevit sample by yourself, for example following the steps described in Chapter 2, Walkthroughs, in the developer guide. Go through the Labs code, and look at some Revit SDK samples. The following SDK samples will be a good starting point:

3. For More Information

4. .NET and C# Tutorials and Books

In a followup to the note on removing an add-in registered by the wizard, Bryan Thatcher asks:

Question: I have programming experience starting with Qbasic, VBA, VB5, some C and C++, but I'm new to C# and the added complexity of the Revit API has been a challenge. I have learned a lot from your blog, but can you recommend a comprehensive resource for the Revit API as it relates to C#? All of the material I've found so far has been fragmented.

Answer: I can suggest very little regarding books on this topic. The only books I read myself are novels :-)

I mentioned this .NET learning resource back in 2009, and some free .NET development and architecture e-books in 2010.

I would not worry much about the fragmentation, though. .NET and C# is one thing, the Revit API another.

I would suggest learning C# independently of Revit using any free online tutorial you like, working through the Revit getting started materials bit by bit at the same time, and Bob's your uncle. The DevTV tutorials are extremely easy to follow, require only minimal .NET and programming knowledge, and familiarise you with it step by step as you go along.

Look at the material listed above, and for more, there is the whole getting started category of this blog.