Add Existing Files to Macro Project in IDE
Return to the Revit VSTA IDE. In the Project Explorer (to continue this example) right-click on the folder
you created for your macro, and select Add
➤
Existing Item from the menu. For example:
In the resulting IDE dialog, browse to the corresponding subfolder on the file system, under your Revit
installation folder, select all the files that comprise the macro, and click Add.
In this example, the refreshed IDE Project Explorer for
AppCSharp
contains:
Create and Build Your Macro
Once the files have been added to your project, you can write a method that runs the macro. For example,
in C#:
/// Sample Rooms test
public void RunSampleRooms()
{
SamplesRoom sample = new SamplesRoom(this);
sample.Run();
}
Be sure to add a using directive for the macro's namespace. For example:
using Revit.SDK.Samples.Rooms.CS;
Save the project and then click Build from the IDE toolbar menu. In Revit, launch Macro Manager and select
your macro from the categorized list. On the SDK, the Rooms sample may be coded as a Document-level
macro. In which case, code changes would be needed to run it in the
AppCSharp
project shown in this
section's screens.
When run from Macro Manager, the macro collects data from your model and presents summary information.
Here is an example:
Integrating Macros into Revit VSTA | 1359
Содержание 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 ...