Selecting Your Development Environment

Just about any Microsoft .NET–compatible development environment can be used to generate custom commands and applications for Revit. Just remember that Revit 2012 now requires Microsoft .NET 4.0 for debugging your projects. .NET 3.5 projects will still run in Revit 2012; you just won't be able to step through them in debug mode until they are upgraded to .NET 4.0.

We recommend Visual Studio 2010 for developing .NET applications. Visual Studio comes in many flavors that all range in price and supported features. While Microsoft Visual Studio 2010 Professional is our personal favorite, the Express versions are completely free and fully capable of hosting your Revit API development efforts.

Microsoft's free Express versions of Visual Studio are available for download at www.microsoft.com/express. The Express versions only support one .NET language each, so if you need to work with C# as well as VB.NET you have to download and install both versions.

The settings required to debug your projects in Visual Studio vary depending on which version of Visual Studio you are working with.

Visual Studio 2010 Professional or Higher

Debugging a Revit command or application in Visual Studio 2010 Professional requires that you first enter the full path and filename to Revit.exe in the Start External Program field in the Debug tab of the Project Properties dialog box, as shown in Figure 25.3.

FIGURE 25.3 Visual Studio 2010 Professional debug settings

image

The Revit API does not yet provide a means to interact with the Revit application in an externally defined stand-alone executable file. Entering the full path and filename to a Revit file in the Command Line Arguments field opens the document for debug mode.

Visual Studio 2010 Express Versions

Debugging a Revit command or application in an Express version of Visual Studio 2010 requires that you manually edit the project file of your project. There is no interface to add a startup application or document in the Express version. Adding a startup application is done by adding two XML attributes, StartAction and StartProgram, as shown in Figure 25.4.

FIGURE 25.4 Visual Studio 2010 Express debug settings

image

DEBUGGING ON A 64-BIT OPERATING SYSTEM

You will not be able to edit your code in break mode on a 64-bit operating system in Visual Studio 2010. Use a 32-bit operating system as your development station as a workaround.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset