First, let's answer the question: “What are macros, and why would you use them?” Macros are programs that are designed to help you save time, by automating repetitive tasks. Each macro performs a series of pre-defined steps to accomplish a particular task. The steps should be repeatable and the actions predictable.
For example, you might define a macro to add a grid to your project, to rotate a selected object, or to collect information about the square footage of all the rooms in your structure. Other general examples include:
Revit provides an Application Programming Interface (API) that allows you to extend the functionality of the product. You can add customized commands to the Add-Ins tabExternal Tools panel, or add new panels and tools.
In addition to those API extensions, you can use the API to define macros that run in Revit. Unlike external commands and external applications, the macro functionality is available to Revit from the Revit VSTA add-in. We will explain the API differences later in this topic, but for experienced developers, note that you do not need to register the macros in Revit.ini, or add RevitAPI.dll as a reference.
VSTA is an acronym for Visual Studio Tools for Applications. It is a Microsoft technology that provides the .NET framework for creating macros in C# and VB.NET based on specific applications. VSTA is the next evolution of Visual Basic for Applications (VBA) that appears in several existing Autodesk applications.
The Revit VSTA application is now installed with Revit by default. Also note that Revit uses Microsoft .NET Framework version 3.5. Older applications compiled using .NET 2.0 will continue to function unless otherwise affected by changes in the Revit 2010 API.