Q:
Do I need to edit my Revit.ini files?
A:
No. Once you install Revit VSTA on your Revit product installation, Revit knows the API for the macro
support.
Q:
In the Revit VSTA IDE, I deleted a macro by removing its method in the This*.cs file or This*.vb file.
However, the deleted macro's name still appears when I open the Macro Manager's categorized list again.
How do I clear the name from the list?
A:
You must build your edited project successfully before Macro Manager recognizes the removal.
Q:
I opened a new Revit Project and tried to start the Macro Manager, but the menu item is disabled. How
do I enable it?
A:
Because macros can be embedded in documents, before starting the Macro Manager or launching the
Revit VSTA IDE, you must first name and Save the project file.
Q:
Why didn't anything happen when I selected File
➤
New Project…" in the Revit VSTA IDE?
A:
The IDE does not support creating a new macro project. The IDE provides four default macro projects:
■
AppCSharp.csproj
■
AppVisualBasic.vbproj
■
DocCSharp.csproj
■
DocVisualBasic.vbproj
You can write macros only in these four projects. Therefore, File
➤
Open Project in the IDE is disabled.
Q:
What are the differences between Application-level and Document-level macros?
A:
Application-level macros can be run on all opened Revit projects within a single instance of the Revit
application. Document-level macro projects are stored within an .rvt file. They can be loaded from within
the current active document and run on that document.
Q:
How do I access the
Application
object or the
externalCommandData
equivalent?
A:
All of the Application-level macros are associated with the
Application
object. In Application-level macros,
the
this
keyword pointer (in C#) or the
Me
keyword pointer (in VB.NET) returns the API
Application
object.
In Document-level macros, the
this
keyword or the
Me
keyword returns the API Document object. To access
the
Application
object from a Document-level macro, use
this.Application
or
Me.Application.
Q:
What should I include in the startup and shutdown methods:
ThisApplication_Startup
,
ThisApplication_Shutdown
,
ThisDocument_Startup
, and
ThisDocument_Shutdown
?
A:
The
ThisApplication_Startup
method is called when Revit starts up and
ThisApplication_Shutdown
is
called when Revit shuts down. Correspondingly,
ThisDocument_Startup
is called when a Revit project opens
Revit Macros FAQ | 1365
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 ...