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:
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):
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 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:
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:
- Fire Rating
3. For More Information
- The Building Coder Revit API blog, also accessible through blogs.autodesk.com/thebuildingcoder, and especially its Getting Started category.
- AEC DevCamp 2010: AEC DevCamp is a bi-annual event. This link includes the comprehensive set of materials up to the Revit 2011 API and is of interest to both beginners and advanced developers. Look under Revit Track 1 (Beginner) and Track 2 (Advanced), contained in the folders starting with 1.x or 2.x.
Autodesk University: AU 2007/2008/2009/2010 –
go to the 'Online Classes' tab.
Search for 'Revit API' and/or under the Developer and Customization tracks.
You should be able to sign up and have access to those materials.
For example, here are a few classes from AU2010 presented by Revit API engineers and the Developer Technical Services team whose materials give you additional, more in-depth information:
- CP319-1 Analyzing Building Geometry using the Revit API – Scott Conover
- CP327-1 Using Dynamic Model Update in the Revit API – Scott Conover
- CP234-2 Revit 2011 Programming Optimization – Jeremy Tammik
- CP228-2 Optimal Use of Revit 2011 Programming Features – Jeremy Tammik
- CP316-1 Presenting Analysis Data in Revit 2011 – Harry Mattison
There is much more. Please search the AU site.
- Autodesk Revit API Discussion Group: go to forums.autodesk.com and select Revit > Revit API.
ADN members-only web site: provided by the Autodesk Developer Network.
- Search DevNotes, whitepapers, and Q&A pages
- Submit questions through DevHelp Online
If you are currently not an ADN member and interested in joining, please refer to becoming an ADN member.
4. .NET, C# 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 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.