Using the Revit Macro Samples from SDK

You can learn various API techniques by using the Revit macro samples provided with the SDK.

Copy and open the following Revit project files from \Software Development Kit\Macro Samples\...:

Included in this RVT file are several document-level macros. In Revit, start the Macro Manager, select one of the document-level macros, and select Run. Note that when you open Revit_Macro_Samples.rvt from the SDK, it may contain more samples than the ones shown in the following screen, and the macro methods may be named differently.

These macros have been preconfigured to run in Revit. In the Macro Manager, you can also select any of the sample macros, and click Edit to see the code created to run that sample. You can also select any of the sample macros and click Edit to see the code created to run that sample.

Revit application-level macro samples are provided with the SDK in \Software Development Kit\Macro Samples\:

Copy and paste macros directories into:

Launch Revit.

Note: Be sure the copied directories are writable. The application-level macros will not run correctly if they are read-only.