In this example, notice that you are building the AppCSharp project. Your Application-level C# macro's
code resides in ThisApplication.cs. You can use the IDE's Project Explorer to see its location on disk.
TIP
After editing a macro's code, remember to build it before opening the Macro Manager again to run it. If your
code is set up correctly, you should see a Build Succeeded message in the lower-left corner (by default) of Revit
VSTA. You do not build macros in the Macro Manager.
Run Macros in Macro Manager
Next, return to Revit. To see the example macro in action, open one of your views, such as a First Floor plan.
As you will note from the code, this Application-level macro adds the Text Note to the active view of the
active document.
View pView = this.ActiveDocument.ActiveView;
this.ActiveDocument.Create.NewTextNote(pView, origin, baseVec, upVec, lineWidth, align,
strText);
Launch Macro Manager again by selecting Tools
➤
Macros
➤
Macros from the toolbar menu. In Macro
Manager, find your macro, select it, and click Run. For example:
Observe the Macro’s Results
After you click run, the macro will execute and should add a Text Note on the current view in Revit. Its
location may be difficult to notice. If you do not see the Text Note added by the macro, you can right-mouse
click anywhere on your view's drawing area and select Zoom to Fit from the menu. For example:
Creating Your First Set of Macros | 1349
Summary of Contents for 24000-000000-9860 - Revit Architecture - PC
Page 1: ...Revit Architecture 2009 User s Guide April 2008 240A1 050000 PM02A ...
Page 4: ......
Page 56: ...18 ...
Page 116: ...78 Chapter 3 Revit Essentials ...
Page 172: ...134 Chapter 4 ProjectViews ...
Page 178: ...Schedule with Grid Lines Schedule with Grid Lines and an Outline 140 Chapter 4 ProjectViews ...
Page 554: ...516 ...
Page 739: ...Curtain wall Curtain Grid Curtain Walls Curtain Grids and Mullions 701 ...
Page 1004: ...966 ...
Page 1136: ...1098 ...
Page 1226: ...1188 ...
Page 1250: ...1212 ...
Page 1276: ...1238 Chapter 20 Design Options ...
Page 1310: ...1272 ...
Page 1366: ...1328 ...
Page 1406: ...1368 ...