There are two different ways to work with the Revit API. In general, the code you write will be the same or almost the same in either case. Developing a macro is easier and simpler, but the trade-off is that you are limited in the development tools you use and how you share the macros with other people. Developing Add-Ins involves more set-up and some technical mumbo-jumbo to register the add-ins with Revit. A main upside of Add-Ins is that you are better able to distribute them to other people.
Here’s a quick review:
SharpDevelop, a free and open-source development environment (known as an Integrated Development Environment, or IDE), is included in the Revit install. It is automatically connected to Revit so the process of creating macros is relatively simple. SharpDevelop is OK, but many people would rather use Microsoft Visual Studio. But to develop macros you must use SharpDevelop.
Macros are automatically registered with Revit when you compile your code in SharpDevelop. The macros are listed in the Macro Manager which is the UI that you must use to run them.
The code for your macro is stored in an RVT file if it is a document macro. If you create an application macro the code is stored independently on your computer. For the application macro examples I have been developing for this blog, Revit stores the source at C:\ProgramData\Autodesk\Revit\Macros\2013\Architecture\VstaMacros\AppHookup\BoostYourBIM\Source\BoostYourBIM.
You can share your macros with other people either by sending them the RVT file (if it is a document macro) or sending them the source code (but that will take a bit of effort on their part to create a macro on their install of Revit to generate the same macro.
Add-Ins are developed externally to Revit, usually using Microsoft Visual Studio, the free version called Visual Studio Express, or some other IDE.
The code for your Add-In gets compiled into a DLL file. An ADDIN file needs to be created so that Revit can discover the DLL. The ADDIN file goes into a place like C:\Users\HP002\AppData\Roaming\Autodesk\revit\Addins\2013. The ADDIN and DLL can be distributed to other users to let them run the command.