The Revit Software Development Kit (SDK) contains useful resources to help you understand the Revit API and to create macros.
The SDK includes the Revit API reference documentation, the full SDK API samples, and the Revit macro samples. The Revit SDK is available on:
The SDK is packaged in a ZIP file. After unzipping the SDK and agreeing to the license text, look for the RevitAPI.chm Help file. On a Windows computer, open the CHM file and refer to the classes, properties, and methods described there.
Also see the Revit macro samples that are part of the SDK. You can find them under:
\Software Development Kit\Macro Samples\...
The next section explains how to integrate the macro Samples into your Revit macro IDE projects.