Code Example After Edits
In the Revit VSTA IDE, we need to update the code as follows. This example shows an Application-level
macro. The method
RunSampleRooms()
is the entry for this VSTA sample. Notice that we used the
this
pointer to replace
commandData.Application
.
Additional Migration Notes for SDK Standard API Samples
Here are some additional notes:
■
By default, the SDK sample namespace is:
Revit.SDK.Samples.<SampleName>.CS
. As you edit the sample
code that came from the SDK standard API samples, be sure to change the namespace for Revit VSTA.
For example, in ThisApplication.cs:
namespace AppCSharp.csproj
■
The default project references in Revit VSTA projects only consist of basic references, such as
Revit.Proxy
.
Remember to add other required references (as shown earlier in this topic). For example, you have to
add
System.Windows.Forms
and
System.Drawing
references when running samples that present a user
interface.
■
Some samples have resources that must be defined in the resources.resx file. GridCreation is one such
sample. If you migrate the SDK standard API sample for GridCreation to Revit VSTA, be sure to set the
resx
property.
■
Project build dependence is not supported within the Revit VSTA IDE. If you want to use other DLLs,
you must compile that dependent sample project outside of Revit VSTA IDE. For example, in the SDK
standard API samples, there are several samples related to Viewers, such as AnalyticalViewer and
RoomViewer, which depend on references to RevitViewer. In the SDK sample's solution, you can set the
project dependences as shown here:
Migrating SDK Samples to Revit VSTA | 1363
Содержание 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 ...