Creating Macros with
Revit VSTA
This topic explains how to create macros in Revit. We will describe macro capabilities, the overall workflow, specific
installation steps, a development environment called Revit VSTA, code examples, frequently asked questions, and related
information about the Revit SDK.
Getting Started with Macros
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:
■
Locating and extracting Revit content to external files
■
Tweaking geometry or parameters
■
Creating many types of elements
■
Importing and exporting external file formats
Revit provides an Application Programming Interface (API) that allows you to extend the functionality of
the product. Experienced developers and Autodesk partners may already know that the Revit API lets them
add customized commands to the Tools
➤
External Commands menu, or add new menus and toolbars.
In addition to those API extensions, starting in the Revit 2009 release 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 after you install an “add-in” called Revit VSTA. 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.
24
1339
Содержание 24000-000000-9860 - Revit Architecture - PC
Страница 1: ...Revit Architecture 2009 User s Guide April 2008 240A1 050000 PM02A ...
Страница 4: ......
Страница 56: ...18 ...
Страница 116: ...78 Chapter 3 Revit Essentials ...
Страница 172: ...134 Chapter 4 ProjectViews ...
Страница 178: ...Schedule with Grid Lines Schedule with Grid Lines and an Outline 140 Chapter 4 ProjectViews ...
Страница 352: ...Defining the first scale vector Defining the second scale vector 314 Chapter 7 Editing Elements ...
Страница 554: ...516 ...
Страница 739: ...Curtain wall Curtain Grid Curtain Walls Curtain Grids and Mullions 701 ...
Страница 898: ...Pile caps with multiple piles Rectangular and triangular pile caps 860 Chapter 12 Working with Structural Components ...
Страница 1004: ...966 ...
Страница 1136: ...1098 ...
Страница 1226: ...1188 ...
Страница 1250: ...1212 ...
Страница 1276: ...1238 Chapter 20 Design Options ...
Страница 1310: ...1272 ...
Страница 1366: ...1328 ...
Страница 1406: ...1368 ...