Installing the Revit 2010 SDK

Compiling the SDK samples

As discussed previously, you can

use SDKSamples2010.sln to compile

all the samples in one fell swoop.
The various sample projects in this solution expect you to have all three flavours of Revit installed in the default locations, otherwise compilation will fail for some of the samples.

So far, I installed only Revit Architecture 2010, not MEP or Structure.
In order to easily compile all the samples anyway, I simply copied the same RevitAPI.dll to the other two locations, so I now have three copies of it on my hard disk:

  • C:Program FilesAutodesk Revit Architecture 2010ProgramRevitAPI.dll
  • C:Program FilesAutodesk Revit MEP 2010ProgramRevitAPI.dll
  • C:Program FilesAutodesk Revit Structure 2010ProgramRevitAPI.dll

Once this was done, I was immediately able to compile all the samples in one go using SDKSamples2010.sln.

I noticed one little omission in the solution file, which you will notice if you try to run the Ribbon sample: the Ribbon sample commands are implemented in a separate assembly using the project file AddInCommands.csproj located in a subdirectory of the Ribbon one, and I had to add that to SDKSamples2010.sln myself.

Loading the SDK samples

I use the Revit SDK sample external application RvtSamples to

load all Revit SDK external command samples
.

To set this up for Revit 2010, I performed the following steps:

  • I edited RvtSamples.txt in the SDK/Samples/RvtSamples folder and replaced Z:SDK2010Samples by my local SDK samples path.
  • I compiled the RvtMgdDbg for 2010.
  • I added an ExternalApplications section to Revit.ini in the Revit Program folder, with entries for the external applications RvtMgdDbg and RvtSamples:

[ExternalApplications]
EACount=2
EAAssembly1=C:Program FilesAutodesk Revit Architecture 2010ProgramRvtMgdDbg.dll
EAClassName1=RvtMgdDbg.App
EAAssembly2=C:alibrevit2010SDKSamplesRvtSamplesCSRvtSamples.dll
EAClassName2=RvtSamples.Application

That’s it, I am done and can now start up Revit.
The Add-Ins menu item is available and the corresponding panel displayed even in zero document state:

RvtMgdDbg and RvtSamples in Add-Ins panel

RvtMgdDbg is up and running in its own panel:

RvtMgdDbg Add-Ins panel

RvtSamples now displays the samples sorted by category only, there are no longer any multiple menu hierarchies by various different classifications.
Even though it is displayed in the zero document state, the menu entries are not active until a document has been opened:

RvtSamples pulldown buttons

Updating the ADN training material

The next thing I am interested in is updating the Revit API introduction labs and all the rest of our training material to 2010.
One looming deadline is the upcoming

webcast on the Revit API

on April 29th, one of our ADN

training classes
,
which will require this material.

By the way, our webcast plans for this year are more elaborate than in previous years.
We are thinking of holding this first webcast to cover the basics and discuss new API areas, and following it up with several dedicated sessions focusing in more depth on various areas affected by the new API functionality, such as:

  • Family editor user interface features
  • Family API
  • Conceptual design API and form creation
  • Revit MEP API

I’ll keep you posted as these plans mature.


Comments

6 responses to “Installing the Revit 2010 SDK”

  1. Can you use the Visual Studio “Edit and Continue” feature with Revit 2010?

  2. Dear Jamie,
    I am sorry to say that that the Visual Studio “Edit and Continue” feature does not work with Revit 2010. Currently, the only known workaround is to develop code in VSTA, which offers the ability to modify code interactively in the same Revit session.
    Personally, I set up the Visual Studio project to start up Revit with a testing project loaded. Then I can hit Alt-D-E in Visual Studio to stop debugging, and F5 to start up debugging again, continuing in the same project exactly where I left off. That is efficient enough for me. Sorry for the bad news.
    Cheers, Jeremy.

  3. Hi Jeremy,
    Do you know if ‘Edit and Continue’ will be back in a subsequent release or update?
    thanks
    Ed

  4. Dear Ed,
    The development team have looked at the issue very carefully. They know what is causing it and how important it is for developers, but it would be a lot of work to change it. It is scheduled to be done, but nobody can say exactly when the fix will happen.
    Cheers, Jeremy.

  5. Jan S Yoder Avatar
    Jan S Yoder

    RE: Adding ExternalApplications to Revit.ini
    Be sure you set your text editor to UTF-8 encoding. I was using one that was set (by default) to UNICODE. Every time I started Revit MEP 2010 the whole file would be rebuilt, thus losing paths and other valuable information.
    This took quite a while to figure out. A warning message from Revit would have been MOST helpful.
    Thanks, Jan

  6. Dear Jan,
    Thank you for that hint. I can imagine that that took a while to discover. I myself often use the simplest possible, Notepad with an ANSI encoding, and I have not had any problems with that.
    Cheers, Jeremy.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading