Autodesk 24000-000000-9860 - Revit Architecture - PC User Manual page 1401

User guide
Table of Contents

Advertisement

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()
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:
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
Remember to add other required references (as shown earlier in this topic). For example, you have to
add
System.Windows.Forms
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
property.
resx
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:
is the entry for this VSTA sample. Notice that we used the
.
Revit.SDK.Samples.<SampleName>.CS
and
references when running samples that present a user
System.Drawing
Migrating SDK Samples to Revit VSTA | 1363
this
. As you edit the sample
.
Revit.Proxy

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 24000-000000-9860 - Revit Architecture - PC and is the answer not in the manual?

Table of Contents

Save PDF