Revit2011 –Compiled SDK for consumption

by Guy Robinson 29. April 2010 11:12

I’ve had some requests for compiled assemblies of the Autodesk Revit 2011 API SDK samples. They’re useful for those of you who don’t have Visual Studio installed or don’t know how to compile them.  Or if you’re wondering what’s supplied in the SDK and just what’s possible with the API. This isn’t as user friendly as it could be due to the number of commands, but here’s a download of all SDK samples . The SDK is an impressive resource now.

Note: These are Autodesk SDK Samples . I haven’t tested them all so if you find something that doesn’t work let me know. The API team had a huge job migrating to the 2011 API so I wouldn’t be surprised if some didn’t work correctly at the moment. If it’s an easy fix I’ll update the download.Because they’re Autodesk samples they’re covered by their licence:

Permission to use, copy, modify, and distribute this software in object code form for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies and that both that copyright notice and the limited warranty and restricted rights notice below appear in all supporting documentation.

AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED OR ERROR FREE.

Use, duplication, or disclosure by the U.S. Government is subject to restrictions set forth in FAR 52.227-19 (Commercial Computer Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical Data and Computer Software), as applicable.

If you’ve installed the samples correctly you should see 5-6 extra tabs (depending on discipline) with all the commands available via the new tabs on the ribbon. MEP and Structure will have an extra tab for commands specific to their disciplines. All other commands should run on any Revit discipline. I have used a generic icon for the button images, hopefully this isn’t too confusing.

Here’s my Revit installation running the SDK samples.

SDKtabs

Any files (.rvt,.rfa,.xlsx) relevant to the command are in the files subdirectory. ReadMe files for each command are in the help subdirectory.

To Install Samples

1..  Download the zip (SDKSamples.zip) from here and unpack the zip to the required directory. Remember to unblock the zip if running Win7.

2..  In the package directory there is a Console application called RunMeToInstallAddIns.exe.

There appears to be an issue with this and the RevitAddInUtility.dll versioning. Although it works for me. It doesn’t work for others. I’m still trying to figure out what’s happening and why. I will update ASAP.

Run this to install the SDK addins to the current users directory. Note, you must have administrator rights to run this application. If you don’t , then you will have to update the assembly path of the addin in a text editor. The SDKSamples.addin is the addin for the command that adds the SDK commands as 5-6 ribbon tabs.

The line you need to edit is the assembly line in the addin. For example in the SDKSamples.addin this is :

<Assembly>Redbolts.RevitSDK.AppBuilder.dll</Assembly>

Say you unzip to the C:\SDKSamples\package directory then the above line becomes :

<Assembly>C:\SDKSamples\package\Redbolts.RevitSDK.AppBuilder.dll</Assembly>

Save the addin and exit.

To clarify this. If you have had to edit the addin’s manually you then need to copy the .addin files only to the correct directory. Depending on OS these will be:

XP:
C:\Documents and Settings\<user>\Application Data\Autodesk\Revit\Addins\2011\

Vista/Win7:
C:\Users\<user>\AppData\Roaming\Autodesk\Revit\Addins\2011\

To uninstall just delete the .addins from these directories.

3.. Start Revit and you should see the additional tabs. Note there is no checks currently in place to account for a command requiring the user to be in the family editor. So read the readme’s if you’re unsure as to what the command does. 

I’ve tried to group the commands logically. But if I’ve got it wrong do let me know ;-)

Comments (9) -

Gon&#231;alo feio
Gonçalo feio Portugal
5/4/2010 11:59:16 AM #

Hi Guy
I changed the SDKSamples.addin file accordingly (before my post). So, that's not the error.
The RevitAddInUtility.dll is Version=2011.0.2010.326
The error message says it can't find a Version=2011.0.0.0
Is this the problem?
Thanks

Nick Borgmeyer
Nick Borgmeyer United States
5/4/2010 5:41:47 PM #

How do we uninstall these?  Thanks.

Guy Robinson
Guy Robinson
5/4/2010 6:44:35 PM #

@nick,

To uninstall you have to delete the .addin's from your user addin directory. Depending on which OS you're running this will be either:

XP:
C:\Documents and Settings\<user>\Application Data\Autodesk\Revit\Addins\2011\

Vista/Win7:
C:\Users\<user>\AppData\Roaming\Autodesk\Revit\Addins\2011\

Guy Robinson
Guy Robinson
5/4/2010 6:58:33 PM #

Hi Gonçalo,

Not sure what's going on. Will take this to email to see if I can figure it out.

Guy

DoTheBIM
DoTheBIM United States
5/4/2010 7:53:10 PM #

I got this working by just copying everything in the package directory to the users 2011 add-in directory. No editing of addin files. When I ran the installer it just said...

Processing Addin: AssociativeSectionUpdater.addin
Could not load file or assembly 'RevitAddInUtility, Version=2011.0.0.0, Culture=
neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to
load a program with an incorrect format.

Guy Robinson
Guy Robinson
5/4/2010 9:39:35 PM #

@jmartin,

yes that is another approach to solving it. The SDK samples don't depend on RevitAddInUtility.dll only my installer Wink

Gon&#231;alo feio
Gonçalo feio Portugal
5/5/2010 5:31:32 AM #

I just tried your install procedure.
Always get the error:
"Processing Addin: AssociativeSectionUpdater.addin
Could not load file or assembly 'RevitAddInUtility, Version=2011.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to  load a program with an incorrect format."
Any help?

Guy Robinson
Guy Robinson
5/5/2010 5:49:11 AM #

Hi Gonçalo,
Unfortunately the easiest solution is for you to edit the .addin's in a text editor. The SDKSamples.addin is the main one, and I include instructions towards the end of the post on which line to edit and how. Hope that helps.

Cheers, Guy

Gon&#231;alo feio
Gonçalo feio Portugal
5/5/2010 6:09:59 AM #

Hi Guy
But I did that.
The SDKSamples.addin line was changed to:
<Assembly>R:\API\Redbolts\Redbolts.RevitSDK.AppBuilder.dll</Assembly>
Also, explorer says that the RevitAddInUtility.dll is version 2011.0.2010.326 and the error message says:
"Could not load file or assembly 'RevitAddInUtility, Version=2011.0.0.0"
Is that the problem?

Gonçalo

Pingbacks and trackbacks (3)+

Comments are closed

About the Author

A .NET software Developer providing custom applications and commands for architecture firms exclusively working with Autodesk Revit and integration with any associated applications. All from a little place north of Whitianga, New Zealand.

Page List

Disclaimer

I'm self employed so the opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway☺

© Copyright2008

Creative Commons License
Blog content is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

With the following exception. All code snippets, application and libraries are licensed under a a Apache License Version 2.0

Autodesk Revit®

Autodesk: Revit is a product that is wholly owned by Autodesk. Any reference to Revit,Revit API, Revit Architecture, Revit MEP or Revit Structure on this site is made acknowledging this ownership. Refer to Autodesk's own web site and product pages for specific trademark and copyright information. Autodesk represents a great many products and every attempt will be made to respect their ownership whenever one of these other products is mentioned on this site.