2.24.2010

Revit API Resources

If you are interested in getting into the Revit API, you're going to need some resources to help you along. Below are the links to the places that have helped me and continue to help me.


First, the free resources:

Autodesk's DevTV introduction to the API:
http://download.autodesk.com/media/adn/DevTV_Introduction_to_Revit_Programming/

Snoop Tool - RvtMgdDbg:
http://download.autodesk.com/media/adn/RevitAPI_2010_Webcast.zip

AUGI Revit API Discussion Forum:
http://forums.augi.com/forumdisplay.php?f=218

Autodesk Discussion Groups - Autodesk Revit API
http://discussion.autodesk.com/forums/forum.jspa?forumID=160

The Building Coder - Jeremy Tammik
http://thebuildingcoder.typepad.com/blog/

CAD Application Development - Matt Mason
http://cadappdev.blogspot.com/

Revit Programming - Ed Pitt
http://revit-programmer.blogspot.com/

Bolt Out of the Red - Guy Robinson
http://redbolts.com/blog/

Rod.Net - Rod Howarth
http://roddotnet.blogspot.com/
And Rod's Revit API search tool:
http://revitapisearch.rodh.org/

Software Development Kit (SDK)
It comes with your Revit media/DVD or if you downloaded Revit and then installed it, look in C:\Autodesk.
The SDK has lots of samples, the Revit API Developer Guide pdf, and the RevitAPI chm (help) file.



These resources aren't free but may be of great value:

Autodesk Developer Network
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=723353

Your Autodesk Reseller


And finally some personal notes from my experience with the API

Brief Outline of What I Do When Writting Code:

Working with the Revit API is mostly about automating or simplifying something you can already do manually with regular Revit tools. The exception to this may be in the area of analysis tools. So your first steps with any code you make should be to understand the manual steps, menus, dialog boxes, and human interactions involved in your code idea.

Once you have an idea and understand the regular manual process, then use the snoop tool RvtMgdDbg to learn what is exposed in the API. This will help you figure out if what you want to do is possible. Also look at the SDK examples. That may give you some indication of what is possible as well as give you a head start on your code.

Then as you go, use the resources above to help you along and get over rough spots.


Word of Warning
If your code gets ambitious, be careful about ROI. Revit already automates many tedious tasks and is always improving to automate more. So as a rule of thumb, make sure that the payback for the effort you put into making the code and supporting it occurs before the next release of Revit just in case that new release has a viable equivalent to your code.

This warning is especially directed at those like me who are used to complex coding for AutoCAD. AutoCAD is NOT inherently an AEC program and needs ambitious add-ons to make it so. Revit however IS inherently an AEC program and just needs some simpler (analysis tools excepting) helping code to fit it to your company's workflow. So don't get too carried away before doing some risk assesment.

Comments in Your Code
Do yourself and your company a huge favor and put appropriate comments in your source code. If you get hit by a bus (why are buses always getting the bad rap?) and someone else has to continue with your code or you are revisiting or updating your code which you spent a whole year forgetting about, then these comments will come in handy. Mostly my comments start off by outlining the reason why the code was made and the general outline of what it should do. Then throughout I will put in notes about why a certain coding path was chosen or even why certain seemingly obvious coding paths were not chosen. You can look at the code to see what it is doing, but the why is not always obvious but very important.