<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
  <channel>
    <title>BOLT OUT OF THE RED</title>
    <description>Programming or not</description>
    <link>http://redbolts.com/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.0.0.36</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://redbolts.com/blog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Guy Robinson</dc:creator>
    <dc:title>BOLT OUT OF THE RED</dc:title>
    <geo:lat>-36.730000</geo:lat>
    <geo:long>175.690000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BoltOutOfTheRed" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="boltoutofthered" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Technology/Software How-To</media:category><item>
      <title>Compiling and running .NET4.0 Revit commands</title>
      <description>&lt;p&gt;For those of you excited by .NET4.0&amp;rsquo;s new features and wanting to test Revit commands compiled with .NET4.0, you&amp;rsquo;re in luck. Before I show you how, a few caveats:&lt;/p&gt;  &lt;ul&gt;	   	&lt;li&gt;I&amp;rsquo;ve tested this for a few days. While I haven&amp;rsquo;t run into any unexplained issues , there are areas of new functionality in .NET4 that can cause a bit of a head scratch. &lt;/li&gt;    	&lt;li&gt;Of course this is unsupported so you can try submitting a bug but don&amp;rsquo;t be surprised if Autodesk just laugh at you. In other words, &amp;ldquo;testing and inhouse development only please&amp;rdquo;.&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;How to enable .NET4.0&lt;/h3&gt;  &lt;p&gt;Assuming you have .NET4.0 installed, to enable .NET4.0 support change the runtime lines in the Revit.exe.config to the following. Note if this isn&amp;rsquo;t the .NET2 version installed then you need to modify the .NET2 version as required.&lt;/p&gt;  &lt;div&gt;   &lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;     &lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;startup&lt;/span&gt; &lt;span style="color: #ff0000"&gt;useLegacyV2RuntimeActivationPolicy&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;supportedRuntime&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;v4.0&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;supportedRuntime&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;v2.0.50727&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;startup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;The critical line is the useLegacyV2RuntimeActivationPolicy=true. To confirm this is working, create a .NET4 assembly and add the following command.&lt;/p&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;[Transaction(TransactionMode.Manual)]&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;[Regeneration(RegenerationOption.Manual)]&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;[DisplayName(&lt;span style="color: #006080"&gt;&amp;quot;Test NET40&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;[Description(&lt;span style="color: #006080"&gt;&amp;quot;Test NET4.0 test command&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Command:IExternalCommand&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #cc6633"&gt;#region&lt;/span&gt; Implementation of IExternalCommand&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Result Execute(ExternalCommandData commandData, &lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message, ElementSet elements)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var uiApplication = commandData.Application;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var application = uiApplication.Application;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var uiDocument = uiApplication.ActiveUIDocument;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var document = uiDocument.Document;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var transaction = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Transaction(document, &lt;span style="color: #006080"&gt;&amp;quot;test .NET4.0&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            transaction.Start();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            var td = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TaskDialog(&lt;span style="color: #006080"&gt;&amp;quot;Test Version4&amp;quot;&lt;/span&gt;) { MainContent = &lt;span style="color: #006080"&gt;&amp;quot;Running CLR &amp;quot;&lt;/span&gt; + Environment.Version.ToString() };&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            td.Show();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            transaction.Commit();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Succeeded;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (transaction.HasStarted()) transaction.RollBack();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #cc6633"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Enjoy!!! Looking forward to seeing some Revit-&amp;gt;Windows Phone7 mashups!!&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Just to clarify, although you can test .NET4 commands Revit is unusable with .NET4 enabled. It causes Revit to crash as soon as you select a standard command.&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/05/31/Compiling-and-running-NET40-Revit-commands.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/05/31/Compiling-and-running-NET40-Revit-commands.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=1e3311d2-8dce-4cad-9a15-d7b9cec040b3</guid>
      <pubDate>Mon, 31 May 2010 14:04:00 +1400</pubDate>
      <category>.NET 4.0</category>
      <category>Revit 2011</category>
      <category>RevitAPI</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=1e3311d2-8dce-4cad-9a15-d7b9cec040b3</pingback:target>
      <slash:comments>19</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=1e3311d2-8dce-4cad-9a15-d7b9cec040b3</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/05/31/Compiling-and-running-NET40-Revit-commands.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=1e3311d2-8dce-4cad-9a15-d7b9cec040b3</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>RevitAddinUtility x32/x64</title>
      <description>&lt;p&gt;&lt;a href="http://thebuildingcoder.typepad.com/blog/2010/05/revitaddinutility-for-32-and-64-bit-systems.html" target="_blank"&gt;Jeremy&lt;/a&gt; nicely summed up the issues with the RevitAddUtility.dll . I thought I&amp;rsquo;d document my solution which uses interfaces to solve the issue. The problem is the loader exception fires before your application can catch it. By using interfaces you can utilise the appropriate assemblies which maintaining a single main application and no file copying.&lt;/p&gt;  &lt;p&gt;Depending on which platform you run it on, the console app should utilise the correct assembly. In this example it just prints the names of any revit applications installed.&lt;/p&gt;  &lt;p&gt;Here&amp;rsquo;s the console code for reference.&lt;/p&gt;  &lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; height: 224px; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;   &lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;     &lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;var assemDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;var current = AppDomain.CurrentDomain;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;IAddInFactory addinFactory;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// assume 64bit is more common now&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var addInAssemName = AssemblyName.GetAssemblyName(Path.Combine(assemDir, &lt;span style="color: #006080"&gt;@&amp;quot;Redbolts.AddIn.AddIn64Factory.dll&amp;quot;&lt;/span&gt;)).FullName;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    addinFactory = (IAddInFactory)current.CreateInstanceAndUnwrap(addInAssemName,&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #006080"&gt;&amp;quot;Redbolts.AddIn.AddIn64Factory.AddInFactory&amp;quot;&lt;/span&gt;, &lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;, BindingFlags.Default, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; , &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Successfully loaded 64bit OS version of RevitAddInUtility&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    addinFactory = (IAddInFactory)current.CreateInstanceFromAndUnwrap(Path.Combine(assemDir, &lt;span style="color: #006080"&gt;@&amp;quot;OS32\Redbolts.AddIn.AddIn32Factory.dll&amp;quot;&lt;/span&gt;),&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #006080"&gt;&amp;quot;Redbolts.AddIn.AddIn32Factory.AddInFactory&amp;quot;&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;, BindingFlags.Default, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Console.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;Successfully loaded 32bit OS version of RevitAddInUtility&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (addinFactory!= &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Console.WriteLine(addinFactory.RevitInstalledApplications.Count());&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; revitInstalledApplication &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; addinFactory.RevitInstalledApplications)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        Console.WriteLine(revitInstalledApplication);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;Console.ReadLine();&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;And here&amp;rsquo;s the example app (VS2010 solution)&amp;nbsp;&lt;a href="http://redbolts.com/blog/file.axd?file=2010%2f5%2fExampleAddInConsole.zip"&gt;ExampleAddInConsole.zip (44.82 kb)&lt;/a&gt;&amp;nbsp;enjoy!!&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/05/20/RevitAddinUtility-x32x64.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/05/20/RevitAddinUtility-x32x64.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=430f3e03-94af-444b-bd5f-d9657caa18fd</guid>
      <pubDate>Thu, 20 May 2010 15:12:00 +1400</pubDate>
      <category>Revit 2011</category>
      <category>RevitAPI</category>
      <category>RevitAddInUtility</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=430f3e03-94af-444b-bd5f-d9657caa18fd</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=430f3e03-94af-444b-bd5f-d9657caa18fd</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/05/20/RevitAddinUtility-x32x64.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=430f3e03-94af-444b-bd5f-d9657caa18fd</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator><enclosure url="http://redbolts.com/blog/file.axd?file=2010%2f5%2fExampleAddInConsole.zip" length="45894" type="application/octet-stream" /><media:content url="http://redbolts.com/blog/file.axd?file=2010%2f5%2fExampleAddInConsole.zip" fileSize="45894" type="application/octet-stream" /></item>
    <item>
      <title>IFC has no place in your Revit BIM workflow</title>
      <description>&lt;p&gt;&lt;a href="http://revitoped.blogspot.com/2010/04/i-speak-ifc.html" target="_blank"&gt;Steve’s post on IFC&lt;/a&gt; and the comments that follow, mirror discussions I’ve had on &lt;a href="http://www.iai-tech.org/products/ifc_specification/index_html" target="_blank"&gt;IFC&lt;/a&gt; on numerous occasions. I’m going to be more blunt than Steve though ;-) . Don’t get me wrong, an open interoperability layer is vital for BIM but IFC is not the long term solution.&amp;#160;  For archiving and satisfying jurisdictions that require an open solution, IFC is arguably the only solution currently, however even then it is an incomplete solution. Good luck opening a current generation IFC model in 20 years or the structural analysis. &lt;/p&gt;  &lt;p&gt;Before I continue, I better state some caveats:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;I don’t know what Autodesk think of IFC, although they were one of the originators of the project. I have had no discussions with the Factory on IFC support or plans. &lt;/li&gt;    &lt;li&gt;What I believe to be the preferred long term solution for model communication is currently not a complete solution . &lt;/li&gt;    &lt;li&gt;My main concern here is discussing data exchange during the design phase.&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Why IFC is bad&lt;/h3&gt;  &lt;p&gt; The problem with IFC is it takes a lowest common dominator approach to BIM. So even though Revit has IFC certified importers and exporters there is invariably a loss of data fidelity. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/IFChasnoplaceinyourBIMworkflow/2F2484C6/IFC2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IFC2" border="0" alt="IFC2" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/IFChasnoplaceinyourBIMworkflow/25E84985/IFC2_thumb.png" width="244" height="198" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;An example of this is the new ‘improved IFC’ plugins Graphisoft have written for ArchiCAD 14 to Revit Structure and MEP . Frankly, this shouldn’t be required if IFC was the solution for interoperability. Yes Autodesk could improve the IFC translators in Revit to improve the ArchiCAD experience. But then in lies the problem, every vendor who has an application that implements IFC has to account for subtle differences in implementation or mapping to their object models . This increases the amount of testing and development required for each and every IFC application that is utilising your IFC files. Not to mention the broken workflow.&lt;/p&gt;  &lt;h3&gt;The way forward&lt;/h3&gt;  &lt;p&gt;What is an open standard? I believe Autodesk’s idea of open is a freely available self documenting API as we have with Revit. The fact it’s not a complete API is really the problem. Were all vendors of BIM applications to commit to full open API’s for their applications we would be able to implement lossless interfaces to our 3rd party applications. While this may increase the amount of upfront development, by the use of well designed code libraries this can be minimised. It will have the benefit of significantly reducing testing requirements as well as providing the possibility of a richer user experience more suited to the host vendors application. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/IFChasnoplaceinyourBIMworkflow/041C70F4/IFC.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IFC" border="0" alt="IFC" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/IFChasnoplaceinyourBIMworkflow/57270E18/IFC_thumb.png" width="244" height="198" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Full open API’s are inherently self testing, it would not be a lot of effort to test this for the major BIM vendors. Were 3rd party vendors to commit to open API’s as well, interesting mashups would result further increasing the rate of BIM innovation. Because open API’s are self documenting it allows vendors to innovate rapidly without having to worry about maintaining IFC compliance. This would significantly reduce testing. &lt;/p&gt;  &lt;p&gt;Using the existing Revit API as an example, we are now starting to see the benefits of this open API approach. The new &lt;a href="http://labs.autodesk.com/utilities/ecotect/" target="_blank"&gt;solar radiation technology preview&lt;/a&gt; for Revit 2011 is an excellent example of a fluid user experience in this case implemented within the Revit UI using the Revit API. Equally the API could be used for direct external communication of object data.&lt;/p&gt;  &lt;h3&gt;Archiving&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://revitoped.blogspot.com/2010/04/i-speak-ifc.html" target="_blank"&gt;Steve&lt;/a&gt; summed it up nicely:&lt;/p&gt;  &lt;p&gt;“If we don't print stuff at some point in the future for archiving and just rely on it being available digitally everything will have to be saved/stored in some &amp;quot;neutral&amp;quot; format...not just BIM or CAD or doc files etc.”&lt;/p&gt;  &lt;p&gt;I don’t see IFC as any more a guarantee for archived BIM projects than a closed Autodesk file format. And regardless of which file format, would a BIM project file be a true reflection of a buildings’ as built state in 20 years time? The only real solution for all data is to serialise it into a human readable format like XML. Entirely possible with a full open API.&lt;/p&gt;  &lt;h3&gt;A Revit user and don’t agree?&lt;/h3&gt;  &lt;p&gt;If you’re a Revit user and you don’t agree then you better start searching for an alternative because Revit is living proof IFC plays no role in a fluid BIM experience. Revit Structure and Revit MEP both use direct integration and 3rd party analysis via the API to provide a workflow than would never be possible via IFC. The new &lt;a href="http://labs.autodesk.com/utilities/ecotect/" target="_blank"&gt;solar radiation technology preview&lt;/a&gt; for Revit 2011 is just the start. As the API develops we’ll see further examples of direct integration via the API providing an improved BIM and IPD experience over the IFC alternative.&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;&amp;#160; What will provide a vastly improved experience for architects and all those involved in building design is not better IFC tools from Autodesk and other vendors but a move by vendors to open and full API’s for their applications. And that goes for the 3rd party vendors as well. This would allow lossless data exchange and vastly improved BIM workflows.&lt;/p&gt;  &lt;p&gt;So if you want to hassle Autodesk about anything, hassle them about the API and extending it to provide a lossless bi-directional pipe to 3rd party applications. If a vendor is moaning about IFC, tell them to look to the API instead. There is much missing in the current API around element configuration and element creation.&lt;/p&gt;  &lt;p&gt;I see a full API as a win-win for Autodesk and end users. They get to concentrate on innovation without having to reveal and document their file formats or trying to convert to a lower common dominator file format such as IFC. The end user gets a framework for rich, interactive applications that will increasingly become required tools for BIM and IPD.&lt;/p&gt;  &lt;p&gt;For project archiving, I don’t see IFC as anymore a guarantee than any other solution.&amp;#160; A move to vendor supported serialisation of project data along with the appropriate schema would seem to be the only real possibility for lossless rebuilding of projects in the future. Even then, would the model represent the current as built structure? With the current state of the Revit API a certain level of serialisation is possible now. With published schema that mirror the API it would be possible to write rich importers for future versions of Revit or any other BIM application.&lt;/p&gt;  &lt;p&gt;In conclusion, while some vendors and countries are pushing IFC, BIM and in particular IPD is still in it’s infancy. A push for software vendors to provide full open API’s to their application would I believe, provide a win-win for vendors and users. So hassle Autodesk about the API and hassle your 3rd party software vendors about the API instead of IFC.&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/05/20/IFC-has-no-place-in-your-Revit-BIM-workflow.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/05/20/IFC-has-no-place-in-your-Revit-BIM-workflow.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=ede23ed9-877c-40f3-a53a-0b1621097678</guid>
      <pubDate>Thu, 20 May 2010 12:40:12 +1400</pubDate>
      <category>RevitAPI</category>
      <category>Autodesk Revit</category>
      <category>IFC</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=ede23ed9-877c-40f3-a53a-0b1621097678</pingback:target>
      <slash:comments>17</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=ede23ed9-877c-40f3-a53a-0b1621097678</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/05/20/IFC-has-no-place-in-your-Revit-BIM-workflow.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=ede23ed9-877c-40f3-a53a-0b1621097678</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Revit2011 –Compiled SDK for consumption</title>
      <description>&lt;p&gt;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.&amp;#160; 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 &lt;a href="http://www.redbolts.com/R2011SDK/SDKSamples.zip" target="_blank"&gt;here’s a download&lt;/a&gt; of all SDK samples . The SDK is an impressive resource now.&lt;/p&gt;  &lt;p&gt;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:&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;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.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;AUTODESK PROVIDES THIS PROGRAM &amp;quot;AS IS&amp;quot; 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.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;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.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;Here’s my Revit installation running the SDK samples.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011SDKCompiledSamplesforconsumptio/28DBA99D/SDKtabs.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SDKtabs" border="0" alt="SDKtabs" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011SDKCompiledSamplesforconsumptio/06376B22/SDKtabs_thumb.png" width="510" height="65" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Any files (.rvt,.rfa,.xlsx) relevant to the command are in the files subdirectory. ReadMe files for each command are in the help subdirectory. &lt;/p&gt;  &lt;h2&gt;To Install Samples&lt;/h2&gt;  &lt;p&gt;1..&amp;#160; Download the zip (SDKSamples.zip) from &lt;a href="http://www.redbolts.com/R2011SDK/SDKSamples.zip" target="_blank"&gt;here&lt;/a&gt; and unpack the zip to the required directory. Remember to unblock the zip if running Win7.&lt;/p&gt;  &lt;p&gt;2..&amp;#160; In the package directory there is a Console application called RunMeToInstallAddIns.exe.&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;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.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt; 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.&lt;/p&gt;  &lt;p&gt;The line you need to edit is the assembly line in the addin. For example in the SDKSamples.addin this is :&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;&amp;lt;Assembly&amp;gt;Redbolts.RevitSDK.AppBuilder.dll&amp;lt;/Assembly&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Say you unzip to the C:\SDKSamples\package directory then the above line becomes :&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;&amp;lt;Assembly&amp;gt;C:\SDKSamples\package\Redbolts.RevitSDK.AppBuilder.dll&amp;lt;/Assembly&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Save the addin and exit.&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;To clarify this. If you have had to edit the addin’s manually you then need to copy the .addin files &lt;strong&gt;only&lt;/strong&gt; to the correct directory. Depending on OS these will be:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;XP:     &lt;br /&gt;C:\Documents and Settings\&amp;lt;user&amp;gt;\Application Data\Autodesk\Revit\Addins\2011\&lt;/font&gt;&lt;/p&gt; &lt;font color="#008000"&gt;   &lt;p&gt;Vista/Win7:     &lt;br /&gt;C:\Users\&amp;lt;user&amp;gt;\AppData\Roaming\Autodesk\Revit\Addins\2011\&lt;/p&gt;    &lt;p&gt;To uninstall just delete the .addins from these directories. &lt;/p&gt;    &lt;p&gt;&lt;/p&gt; 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.&amp;#160; &lt;/font&gt;  &lt;p&gt;I’ve tried to group the commands logically. But if I’ve got it wrong do let me know ;-) &lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/04/29/Revit2011-e28093Compiled-SDK-for-consumption.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/04/29/Revit2011-e28093Compiled-SDK-for-consumption.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=5cb0a015-2a66-4531-a479-35c54e36fe61</guid>
      <pubDate>Thu, 29 Apr 2010 11:12:04 +1400</pubDate>
      <category>SDK Samples</category>
      <category>Autodesk Revit</category>
      <category>Revit 2011</category>
      <category>RevitAPI</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=5cb0a015-2a66-4531-a479-35c54e36fe61</pingback:target>
      <slash:comments>12</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=5cb0a015-2a66-4531-a479-35c54e36fe61</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/04/29/Revit2011-e28093Compiled-SDK-for-consumption.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=5cb0a015-2a66-4531-a479-35c54e36fe61</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator><enclosure url="http://www.redbolts.com/R2011SDK/SDKSamples.zip" length="56457884" type="application/x-zip-compressed" /><media:content url="http://www.redbolts.com/R2011SDK/SDKSamples.zip" fileSize="56457884" type="application/x-zip-compressed" /></item>
    <item>
      <title>Revit2011 API standout feature – being Idle</title>
      <description>&lt;p&gt;To be honest I&amp;rsquo;m loathed to single out a single standout feature from the new API&amp;rsquo;s. There is no doubt Updaters are going to be widely use. They plug a major gap in the API&amp;rsquo;s capabilities, the Updater API is well designed and are fast. However, there is a single API that does standout and in my opinion allows developers to begin the process of seamlessly integrating Revit into users BIM workflows unlike anything that has been possible before. And that API is the Application Idling event.&lt;/p&gt;  &lt;p&gt; What happens is every time a user does nothing ;-) Revit will fire an application idling event. API developers can subscribe to this and do some work. The developer needs to make sure they don&amp;rsquo;t spend too much time in the handler and provide visual feedback on what they&amp;rsquo;re doing or the user experience will be significantly degraded and potential confusion.&amp;nbsp;&lt;/p&gt;  &lt;p&gt;There are a number of patterns possible with the Idling event and I&amp;rsquo;ll cover a simple one initially. Essentially this pattern replicates what updaters can do but in a more asynchronous manner. Although in the example command I&amp;rsquo;m not doing anything with the data. It uses an Idling event in conjunction with a DocumentChanged event to queue elements to be processed as required. The processing will only happen when Revit is idle.Here&amp;rsquo;s a screen shot:&lt;/p&gt;  &lt;p&gt;&lt;a rel="lightbox" href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011APIstandoutfeaturebeingIdle/72BDB645/Idle1.png"&gt;&lt;img style="display: inline; border-color: initial; border-style: initial; border-width: 0px" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011APIstandoutfeaturebeingIdle/4CE78FE2/Idle1_thumb.png" border="0" alt="Idle1" title="Idle1" width="244" height="106" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The command opens a window that stays on top, that can be moved but not closed. The count shows the number of items in the queue to be processed and the status shows whether Revit is working or idling (orange working, green idle). I&amp;rsquo;ve intentionally slowed things down to try and show you how and when the idle event fires and the instances in the queue are processed. Create a number of elements in succession (like walls without chaining) and then double escape and watch the queue count and status update. Pretty damn cool!!&lt;/p&gt;  &lt;p&gt;The essential class is the DataService singleton class . It&amp;rsquo;s this class I use to wire up the Idling and DocumentChanged events and generate the queue of ChangedIdTick instances to process. Here&amp;rsquo;s the event handlers for the Revit Idling and DocumentChanged events:&lt;/p&gt;  &lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;   &lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;     &lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// Documents changed event handler.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;sender&amp;quot;&amp;gt;The sender.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;e&amp;quot;&amp;gt;The &amp;lt;see cref=&amp;quot;Autodesk.Revit.DB.Events.DocumentChangedEventArgs&amp;quot;/&amp;gt; instance containing the event data.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DocumentChanged(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, DocumentChangedEventArgs e)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var activeDocument = e.GetDocument();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// this allows us to reference the document by name rather than storing documents in the queue&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!_docTable.ContainsKey(activeDocument.Title)) _docTable.Add(activeDocument.Title, activeDocument);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// now add a tick to the queue&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    _queue.Enqueue(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ChangedIdTick(activeDocument.Title, e.GetAddedElementIds(), e.GetModifiedElementIds(), e.GetDeletedElementIds()));&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// Applications idling event handler.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;sender&amp;quot;&amp;gt;The sender.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;e&amp;quot;&amp;gt;The &amp;lt;see cref=&amp;quot;Autodesk.Revit.UI.Events.IdlingEventArgs&amp;quot;/&amp;gt; instance containing the event data.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ApplicationIdling(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, IdlingEventArgs e)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (_queue.Count != 0)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        &lt;span style="color: #008000"&gt;// if the queue has some ticks get one and sleep for 1/2 second&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var tick = _queue.Dequeue();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        Thread.Sleep(500);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;//set the count rather than expose the queue to the viewmodel&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Count = _queue.Count;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// now raise the event on the viewmodel&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    OnRevitWasIdle(EventArgs.Empty);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;And then the DataViewModel class provides the bridge between the revit dataservice and the WPF window. It subscribes to the DataServices&amp;rsquo;s RevitWasIdle event which the dataservice fires when it&amp;rsquo;s completed handling the Revit Idle event. The DataViewModel then updates the UI accordingly via databinding. If there are other aspect you&amp;rsquo;d like me to describe feel free to comment. I&amp;rsquo;ve tried to comment the code appropriately. Here&amp;rsquo;s the DataViewModel&amp;rsquo;s handler for the RevitWasIdle event.&lt;/p&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// idle handler for dataservice.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;sender&amp;quot;&amp;gt;The sender.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;args&amp;quot;&amp;gt;The &amp;lt;see cref=&amp;quot;System.EventArgs&amp;quot;/&amp;gt; instance containing the event data.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RevitWasIdleHandler(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs args)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    IsIdle = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Count = _revitDataService.Count.ToString();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// using a dispatch timer to leave the idling radio button &lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// on for a 1 second&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #008000"&gt;// leave IsIdle on for 1 second if it&amp;#39;s not already running&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!_dispatcherTimer.IsEnabled) _dispatcherTimer.Start();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Maybe you don&amp;rsquo;t find this Idle exciting. But you might (should) when I post the next pattern&amp;hellip;&lt;/p&gt;&lt;p&gt;Exciting times!!!&lt;/p&gt;&lt;p&gt;Code in the &lt;a href="http://redbolts.com/blog/page/Downloads.aspx" target="_blank"&gt;usual place&lt;/a&gt;. Note it&amp;rsquo;s a VS2010 project so if you&amp;rsquo;re on 2008 delete the .sln and open the .csproj directly, and you&amp;rsquo;ll need to update the path in the addin or use the AddInManager from the SDK to use the binary.&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/04/19/Revit2011-API-standout-feature-e28093-being-Idle.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/04/19/Revit2011-API-standout-feature-e28093-being-Idle.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=42abd674-46de-4adb-8054-b95dd9e91b2e</guid>
      <pubDate>Mon, 19 Apr 2010 13:36:00 +1400</pubDate>
      <category>Autodesk Revit</category>
      <category>Revit 2011</category>
      <category>RevitAPI</category>
      <category>IdlingAlong</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=42abd674-46de-4adb-8054-b95dd9e91b2e</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=42abd674-46de-4adb-8054-b95dd9e91b2e</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/04/19/Revit2011-API-standout-feature-e28093-being-Idle.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=42abd674-46de-4adb-8054-b95dd9e91b2e</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Revit2011 Transaction Performance</title>
      <description>&lt;p&gt;API performance has always been of interest, even more so as large projects regularly hit &amp;gt;300Mb now. With the new API&amp;rsquo;s such as updaters and the DocumentChanged event performance testing has got a lot more complicated. Throw in transaction and regeneration issues and it soon became obvious a different approach was required. I&amp;rsquo;m not ready to talk about this approach but I thought a little test on transactions speaks volumes about some of the additional design decisions API authors need now consider.&lt;/p&gt;&lt;p&gt;The test comprises 3 commands. One doing a single loop with a single transaction. The second uses a subtransaction per loop. The third one full transaction per loop. each command was run 10 times to average out variation per run. Here&amp;rsquo;s the results:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellspacing="0" cellpadding="0" width="311"&gt;	&lt;tbody&gt;		&lt;tr&gt;			&lt;td width="55"&gt;Run&lt;/td&gt;        			&lt;td width="77"&gt;Single Transaction (ms)&lt;/td&gt;        			&lt;td width="100"&gt;SubTransaction (ms)&lt;/td&gt;        			&lt;td width="77"&gt;Full Transaction (ms)&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;1&lt;/td&gt;        			&lt;td width="77"&gt;795&lt;/td&gt;        			&lt;td width="100"&gt;1544&lt;/td&gt;        			&lt;td width="77"&gt;73085&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;2&lt;/td&gt;        			&lt;td width="77"&gt;852&lt;/td&gt;        			&lt;td width="100"&gt;1553&lt;/td&gt;        			&lt;td width="77"&gt;72935&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;3&lt;/td&gt;        			&lt;td width="77"&gt;778&lt;/td&gt;        			&lt;td width="100"&gt;1556&lt;/td&gt;        			&lt;td width="77"&gt;72797&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;4&lt;/td&gt;        			&lt;td width="77"&gt;784&lt;/td&gt;        			&lt;td width="100"&gt;1554&lt;/td&gt;        			&lt;td width="77"&gt;73170&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;5&lt;/td&gt;        			&lt;td width="77"&gt;781&lt;/td&gt;        			&lt;td width="100"&gt;1536&lt;/td&gt;        			&lt;td width="77"&gt;73837&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;6&lt;/td&gt;        			&lt;td width="77"&gt;789&lt;/td&gt;        			&lt;td width="100"&gt;1564&lt;/td&gt;        			&lt;td width="77"&gt;72334&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;7&lt;/td&gt;        			&lt;td width="77"&gt;787&lt;/td&gt;        			&lt;td width="100"&gt;1533&lt;/td&gt;        			&lt;td width="77"&gt;71912&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;8&lt;/td&gt;        			&lt;td width="77"&gt;778&lt;/td&gt;        			&lt;td width="100"&gt;1541&lt;/td&gt;        			&lt;td width="77"&gt;71782&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;9&lt;/td&gt;        			&lt;td width="77"&gt;793&lt;/td&gt;        			&lt;td width="100"&gt;1550&lt;/td&gt;        			&lt;td width="77"&gt;73472&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;10&lt;/td&gt;        			&lt;td width="77"&gt;777&lt;/td&gt;        			&lt;td width="100"&gt;1524&lt;/td&gt;        			&lt;td width="77"&gt;73290&lt;/td&gt;     		&lt;/tr&gt;		&lt;tr&gt;			&lt;td width="55"&gt;&lt;strong&gt;&lt;font color="#804040"&gt;Average&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;        			&lt;td width="77"&gt;&lt;strong&gt;&lt;font color="#804040"&gt;791.4&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;        			&lt;td width="100"&gt;&lt;strong&gt;&lt;font color="#804040"&gt;1545.5&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;        			&lt;td width="77"&gt;&lt;strong&gt;&lt;font color="#804040"&gt;72861.4&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;     		&lt;/tr&gt;	&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So as you can see subtransactions were twice as slow , this is an excellent result considering 10000 were committed against only one. However as expected the majority of the overhead in the single transaction test was the committing of the single transaction, as can be seen by the Full transaction test being ~9000% slower for 10000 transactions.&lt;/p&gt;&lt;p&gt;So in conclusion I feel we can say:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;em&gt;&amp;ldquo;Utilise subtransactions as required without fear of serious performance degradation. Be very careful when considering multiple transactions within a single command cycle.&amp;rdquo;&lt;/em&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Update:&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 13px; color: #666666; line-height: 20px"&gt;Arno&amp;scaron;t&lt;/span&gt;&amp;nbsp;who is part of the API team at Autodesk left a thorough comment below. So I&amp;#39;ve added his conclusion here:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;em&gt;&amp;ldquo;&lt;span class="Apple-style-span" style="font-family: Arial; font-style: normal; font-weight: normal; font-size: 11px; line-height: 20px"&gt;&lt;strong style="padding: 0px; margin: 0px"&gt;&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: medium"&gt;Do not use neither sub-transactions nor transactions unless you need them, but use them when the end-user benefits from having them&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span" style="font-size: medium"&gt;.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;.&amp;rdquo;&lt;span class="Apple-style-span" style="font-style: normal; font-weight: normal; font-size: 11px"&gt;&amp;nbsp;&lt;/span&gt;&lt;/em&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;And here&amp;rsquo;s the code:&lt;/p&gt;&lt;p&gt;Single Transaction:&lt;/p&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var doc = commandData.Application.ActiveUIDocument.Document;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; LOOPS = 10000;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Stopwatch sw = Stopwatch.StartNew();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var trans = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Transaction(doc, &lt;span style="color: #006080"&gt;&amp;quot;transtest&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    trans.Start();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; LOOPS; i++)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        doc.ProjectInformation.Name = &lt;span style="color: #006080"&gt;&amp;quot;transtest&amp;quot;&lt;/span&gt; + i;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    trans.Commit();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    sw.Stop();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    message = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Elapsed time for {0}== {1}&amp;quot;&lt;/span&gt;, LOOPS, sw.ElapsedMilliseconds);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    message = ex.Message + ex.StackTrace;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Subtransaction:&lt;/p&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var doc = commandData.Application.ActiveUIDocument.Document;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; LOOPS = 10000;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Stopwatch sw = Stopwatch.StartNew();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var trans = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Transaction(doc, &lt;span style="color: #006080"&gt;&amp;quot;transtest&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    trans.Start();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; LOOPS; i++)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var subTrans = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SubTransaction(doc);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        subTrans.Start();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        doc.ProjectInformation.Name = &lt;span style="color: #006080"&gt;&amp;quot;transtest&amp;quot;&lt;/span&gt; + i;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        subTrans.Commit();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    trans.Commit();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    sw.Stop();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    message = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Elapsed time for {0}== {1}&amp;quot;&lt;/span&gt;, LOOPS, sw.ElapsedMilliseconds);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    message = ex.Message + ex.StackTrace;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Full Transaction:&lt;/p&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; margin-top: 20px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow-x: auto; overflow-y: auto; cursor: text; border-width: 1px; border-color: gray; border-style: solid; padding: 4px"&gt;&lt;div style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px"&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    var doc = commandData.Application.ActiveUIDocument.Document;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; LOOPS = 10000;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    Stopwatch sw = Stopwatch.StartNew();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; LOOPS; i++)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    {&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        var trans = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Transaction(doc, &lt;span style="color: #006080"&gt;&amp;quot;transtest&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        trans.Start();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        doc.ProjectInformation.Name = &lt;span style="color: #006080"&gt;&amp;quot;transtest&amp;quot;&lt;/span&gt; + i;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;        trans.Commit();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    }&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    sw.Stop();&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    message = &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #006080"&gt;&amp;quot;Elapsed time for {0}== {1}&amp;quot;&lt;/span&gt;, LOOPS, sw.ElapsedMilliseconds);&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;{&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    message = ex.Message + ex.StackTrace;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Result.Failed;&lt;/pre&gt;&lt;pre style="line-height: 12pt; background-color: white; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow-x: visible; overflow-y: visible; border-style: none; padding: 0px; margin: 0em"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Cheers,&lt;/p&gt;&lt;p&gt;Guy&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/04/17/Revit2011-Transaction-Performance.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/04/17/Revit2011-Transaction-Performance.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=4b32b150-8fe1-4744-b0f4-29829384cd3c</guid>
      <pubDate>Sat, 17 Apr 2010 16:35:00 +1400</pubDate>
      <category>Autodesk Revit</category>
      <category>Performance</category>
      <category>Revit 2011</category>
      <category>RevitAPI</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=4b32b150-8fe1-4744-b0f4-29829384cd3c</pingback:target>
      <slash:comments>18</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=4b32b150-8fe1-4744-b0f4-29829384cd3c</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/04/17/Revit2011-Transaction-Performance.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=4b32b150-8fe1-4744-b0f4-29829384cd3c</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Revit 2011 Custom Ribbon Tab</title>
      <description>&lt;p&gt;At the beginning of the year &lt;a href="http://redbolts.com/blog/post/2010/01/08/Happy-New-Year-e28093-Custom-Ribbon-Tabs-Complete.aspx" target="_blank"&gt;I showed you&lt;/a&gt; how to add your own tab to the Revit Ribbon. I’ve updated this now for Revit 2011.&amp;#160; However, I’ve taken the chainsaw to my code for 2 reasons. The API wasn’t very elegant and the 2011 ribbon seems to behave itself a lot more than the ribbon in Revit 2010. So there is no need to manage context switching as in Revit 2010. Having said this, if anyone finds this new code isn’t behaving please let me know ;-)&lt;/p&gt;  &lt;p&gt;The code is now implemented as an extension method to the UIControlledApplication . This means as long as you reference the extension method namespace correctly you should see this in intellisense when creating a custom tab:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011CustomRibbonTab/69E131D9/IntellisenseTab.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IntellisenseTab" border="0" alt="IntellisenseTab" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011CustomRibbonTab/44773E6B/IntellisenseTab_thumb.png" width="331" height="75" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And when creating a panel there are 2 additional overloads:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011CustomRibbonTab/2DD4F024/IntellisensePanel.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IntellisensePanel" border="0" alt="IntellisensePanel" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011CustomRibbonTab/47C8B046/IntellisensePanel_thumb.png" width="342" height="90" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Although the extension method is contained in the example assembly I’ve designed the extension method to sit in an external common assembly that all your commands use. As long as all your applications use this common assembly you will be able to add panels to a common ribbon tab by name. &lt;/p&gt;  &lt;p&gt;So in summary to add a custom tab use the following :&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Result OnStartup(UIControlledApplication application)
{
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        var tab = application.CreateRibbonTab(&lt;span class="str"&gt;&amp;quot;MyTab&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;And to add a panel to the custom tab there are 2 overloads. The first where you pass the tab instance:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;var tab = application.CreateRibbonTab(&lt;span class="str"&gt;&amp;quot;MyTab&amp;quot;&lt;/span&gt;);
var panel = application.CreateRibbonPanel(tab, &lt;span class="str"&gt;&amp;quot;Test Panel&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;And the second where you name the tab &lt;/p&gt;

&lt;pre class="csharpcode"&gt;var panel = application.CreateRibbonPanel(&lt;span class="str"&gt;&amp;quot;MyTab&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Test Panel&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;rather than creating it explicitly. If the tab with the specified name doesn’t exist the extension method will create it. Code in the &lt;a href="http://redbolts.com/blog/page/Downloads.aspx" target="_blank"&gt;usual place along with a binary and addin&lt;/a&gt;. Note you’ll need to modify the path in the addin .Enjoy!!&lt;/p&gt;

&lt;h2&gt;Journal Comments&lt;/h2&gt;

&lt;p&gt;The example application contains a few other examples of nice new API’s for Revit 2011. The minor one is the ability to easily add a comment to the journal. This is a method to the Revit Application instance so you can add comments from either external applications or external commands:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;Application.WriteJournalComment(&lt;span class="str"&gt;&amp;quot;It's verified you do agree&amp;quot;&lt;/span&gt;,&lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;If you don’t want to write the time your comment was added to the journal use false instead.&lt;/p&gt;

&lt;h2&gt;Task Dialog Boxes&lt;/h2&gt;

&lt;p&gt;The other new API in this example application are Task Dialog boxes. These dialogs will be useful in many situations where you want to alert users to an event , a simple window for getting user feedback, help windows etc. The example pretty much covers all options. A nice feature is the addition of up to 4 linked command buttons providing an easy way to get more than the usual yes/no response to a dialog. In the example application I’ve added 2 commands:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;td.AddCommandLink(TaskDialogCommandLinkId.CommandLink1,&lt;span class="str"&gt;&amp;quot;A jump …&amp;quot;&lt;/span&gt;);
td.AddCommandLink(TaskDialogCommandLinkId.CommandLink2, &lt;span class="str"&gt;&amp;quot;A jump …&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Then a switch to action the user response. Clicking on a link closes the dialog:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;switch&lt;/span&gt; (result)
     {
          &lt;span class="kwrd"&gt;case&lt;/span&gt; TaskDialogResult.Close:
               app.WriteJournalComment(&lt;span class="str"&gt;&amp;quot;closed dialog&amp;quot;&lt;/span&gt;, &lt;span class="kwrd"&gt;false&lt;/span&gt;); &lt;span class="rem"&gt;// writes a &lt;/span&gt;
               &lt;span class="kwrd"&gt;break&lt;/span&gt;;
          &lt;span class="kwrd"&gt;case&lt;/span&gt; TaskDialogResult.CommandLink1:
               Process.Start(&lt;span class="str"&gt;&amp;quot;http://www.lukehurley.co.nz/biomusic/&lt;/span&gt; 
               &lt;span class="kwrd"&gt;break&lt;/span&gt;;
          &lt;span class="kwrd"&gt;case&lt;/span&gt; TaskDialogResult.CommandLink2:
               Process.Start(&lt;span class="str"&gt;&amp;quot;http://www.lukehurley.co.nz/2008/07/06/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="str"&gt;&lt;/span&gt;               &lt;span class="kwrd"&gt;break&lt;/span&gt;;
     }&lt;/pre&gt;
  &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/div&gt;

&lt;p&gt;The other new API I use in the example is the interface IExternalCommandAvailiability to disable the command in the family editor (just wanted to check tab behaviour in the family context). &lt;a href="http://thebuildingcoder.typepad.com/blog/2010/04/revitaddinutility.html" target="_blank"&gt;Jeremy covers this API in depth&lt;/a&gt; so I won’t bother ;-)&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/04/09/Revit-2011-Custom-Ribbon-Tab.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/04/09/Revit-2011-Custom-Ribbon-Tab.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=8daddb86-5fad-4cf1-9439-732b941ce839</guid>
      <pubDate>Fri, 09 Apr 2010 00:14:28 +1400</pubDate>
      <category>Ribbon</category>
      <category>Revit 2011</category>
      <category>Autodesk Revit</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=8daddb86-5fad-4cf1-9439-732b941ce839</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=8daddb86-5fad-4cf1-9439-732b941ce839</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/04/09/Revit-2011-Custom-Ribbon-Tab.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=8daddb86-5fad-4cf1-9439-732b941ce839</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Revit 2011 on Windows Phone 7 Series</title>
      <description>&lt;p&gt;For those who thought the ribbon and Revit were a joke. Well I’ve got news for you. Thanks to the power of the Visual Studio 2010 Phone 7 series development tools and the Revit Ribbon, I’ve been able to get Revit 2011 running on the emulator with the minimum of effort. Although it is a little slow in the emulator.&lt;/p&gt;  &lt;p&gt;Here’s a screenshot of the port of Revit 2011 Architecture running on the Phone 7 emulator. Fantastic stuff. Looking forward to a decent iPad sized device from Windows in the coming months.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011onWindowsPhone7Series/764D68EA/Revit2011Phone.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Revit2011Phone" border="0" alt="Revit2011Phone" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Revit2011onWindowsPhone7Series/4BA16240/Revit2011Phone_thumb.png" width="300" height="189" /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/04/01/Revit-2011-on-Windows-Phone-7-Series.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/04/01/Revit-2011-on-Windows-Phone-7-Series.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=88cd1754-0be0-40c1-a626-35553046af21</guid>
      <pubDate>Thu, 01 Apr 2010 15:05:03 +1400</pubDate>
      <category>WinPhone7</category>
      <category>Revit 2011</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=88cd1754-0be0-40c1-a626-35553046af21</pingback:target>
      <slash:comments>7</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=88cd1754-0be0-40c1-a626-35553046af21</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/04/01/Revit-2011-on-Windows-Phone-7-Series.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=88cd1754-0be0-40c1-a626-35553046af21</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Revit2011 API – What’s in a name?</title>
      <description>&lt;p&gt;As &lt;a href="http://thebuildingcoder.typepad.com/blog/2010/03/revit-2011-is-coming.html"&gt;Jeremy noted&lt;/a&gt; Revit 2011 API has had a major refactoring of the namespaces as well as splitting into 2 assemblies. Before I start talking about the lovely new functionality in this release I want to discuss the implications of this change. In many ways this is the most significant aspect of the Revit2011 API. &lt;/p&gt;  &lt;p&gt;Why have they done this? It’s a huge job and you wouldn’t do it by choice. Related to this is the move away from a relatively unique API in VSTA which used proxies and AppDomains to implement the compile/run/recompile cycle VSTA allows. VSTA now has exactly the same API as the standard API, and some magic for the reload cycle in VSTA. This will make the use of common code libraries in VSTA straightforward and no doubt lower the workload for the API team.&lt;/p&gt;  &lt;p&gt;The basis for the namespace changes is a move by the Factory to using semi-automatic code generation tools to generate the .NET API. Simplistically what this means is the .NET API is as close as we get to a view of the source code. The .NET API’s essentially mirror those used internally for the base Revit application. A classic example of this is the renaming of the Symbol class to ElementType. In .NET {some name}Type naming is usually reserved for enum’s. Yet ElementType is a class in the new API as this is what it’s named in the unmanaged world. For experienced .NET developers and those new to the Revit API a casual parse of the API may be a bit confusing in places but on the whole the new structure of the API and the namespaces is logical. &lt;/p&gt;  &lt;p&gt;The move to code generation tools is very significant for a number of reasons (in no particular order):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;It’s both enlightening and instructive to see how they have designed API’s internally.&lt;/li&gt;    &lt;li&gt;It means the API team should have more time to implement new features rather than fighting the transition between the unmanaged and managed worlds. Testing should be easier. No excuses for missing functionality in the API now ;-) ;-) (Not true as explained below)&lt;/li&gt;    &lt;li&gt;We automatically get a significantly more powerful API. Namely in direct support for Revit transactions ,failures and exception handling API’s. This does mean we can’t avoid implementing transactions at the very least. For beginners it’s yet another thing to understand but luckily the API is both powerful and easy to understand.&lt;/li&gt;    &lt;li&gt;Implementation of new base functionality via the API, is relatively straightforward. 2 good examples of this are the new sheetholder API and reporting parameters. Reporting parameters will be widely used and having API support from day one is fantastic. Robert has a good introduction to them &lt;a href="http://dorevit.blogspot.com/2010/03/revit-2011-reporting-parameters.html"&gt;here&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;More generics and better support for .NET language features in VSTA and the base API.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Given these code generation tools are semi-automatic, for the average punter and API developers I believe it gives us pointers to some of the internal struggles the Factory may be having with the Revit codebase. We’ve all had long standing requests for improvements in stairs, addition of groups, worksets schedules etc in the API as examples. So as we move into future releases of the API, excluding lack of resources if a feature isn’t added in the API we can hazard a guess as to why:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The internal API could be a bit of a mess and doesn’t map well to the .NET world. In this case it’s reasonable to assume the internal API’s are on the todo list for a rework.&lt;/li&gt;    &lt;li&gt;There is major changes in the base application planned and exposing the current API is undesirable. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Undoubtedly this release has been a massive amount of work for the API team and I’m sure they’re well overdue for a holiday. Moving on to future releases though should make their job easier and each new release even more impressive for 3rd party developers. Exciting times!!!&lt;/p&gt;  &lt;p&gt;Just to finish, for those with a reasonable sized legacy codebase and developers in general, the namespace changes are a walk in the park for &lt;a href="http://www.jetbrains.com/resharper/index.html"&gt;Resharper&lt;/a&gt;. So if you’re serious about developing I can strongly recommend &lt;a href="http://www.jetbrains.com/resharper/index.html"&gt;Resharper&lt;/a&gt; . At the moment if you buy V4.5 you get an upgrade to V5 for free. It’s an essential tool for me and has made moving to Revit2011 a walk in the park.&amp;#160; &lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/03/27/Revit2011-API-e28093-Whate28099s-in-a-name.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/03/27/Revit2011-API-e28093-Whate28099s-in-a-name.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=f80d7095-5c3c-4f5e-b937-5a589a2de243</guid>
      <pubDate>Sat, 27 Mar 2010 12:14:03 +1400</pubDate>
      <category>Revit 2011</category>
      <category>RevitAPI</category>
      <category>Autodesk Revit</category>
      <category>Resharper</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=f80d7095-5c3c-4f5e-b937-5a589a2de243</pingback:target>
      <slash:comments>22</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=f80d7095-5c3c-4f5e-b937-5a589a2de243</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/03/27/Revit2011-API-e28093-Whate28099s-in-a-name.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=f80d7095-5c3c-4f5e-b937-5a589a2de243</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Yeah Baby!! Revit 2011 API – the unofficial 4th Discipline</title>
      <description>&lt;p&gt;So apparently we can talk about Revit 2011 now and wow, can we talk about Revit 2011 and the API…&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#800040" size="6"&gt;YEEEEE HHHAAAAAA!!!!!!!!!&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;True be told, my initial reaction on reading the API what’s new.pdf was more like &lt;a href="http://www.youtube.com/watch?v=5nNhOH4Y0bI"&gt;this&lt;/a&gt; (from 1 min 33sec) but apparently that’s NSFW ;-)&lt;/p&gt;  &lt;p&gt;Last year &lt;a href="http://redbolts.com/blog/post/2009/05/07/Revit-2011-the-most-significant-release-EVER.aspx"&gt;I talked about&lt;/a&gt; how this release would be the most important ever. I’ll cover that post in detail later, along with the new functionality . For now I just want to congratulate the Factory and in particular the API team for a massive, exciting and compelling release. And those words don’t do it justice. &lt;/p&gt;  &lt;p&gt;The scale of the improvements suggests a cautious rollout but for most firms of any scale this will be a must have release. For those serious about the API the biggest headache is which lolly do you eat first, the bag is so big. &lt;/p&gt;  &lt;p&gt;If you’re serious about the ‘I’ in BIM, the Revit 2011 API will elevate the API to the unofficial 4th discipline in your Revit toolbag.&lt;/p&gt;  &lt;p&gt;Congratulations Autodesk, the Factory and especially the API team!!&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/03/25/Yeah-Baby!!-Revit-2011-API-e28093-the-unofficial-4th-Discipline.aspx</link>
      <comments>http://redbolts.com/blog/post/2010/03/25/Yeah-Baby!!-Revit-2011-API-e28093-the-unofficial-4th-Discipline.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=9bbc4afe-36d9-44ff-b2a3-6ba2d66e2eb5</guid>
      <pubDate>Thu, 25 Mar 2010 22:54:44 +1400</pubDate>
      <category>Autodesk Revit</category>
      <category>RevitAPI</category>
      <category>Revit 2011</category>
      <dc:publisher>Guy Robinson</dc:publisher>
      <pingback:server>http://redbolts.com/blog/pingback.axd</pingback:server>
      <pingback:target>http://redbolts.com/blog/post.aspx?id=9bbc4afe-36d9-44ff-b2a3-6ba2d66e2eb5</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=9bbc4afe-36d9-44ff-b2a3-6ba2d66e2eb5</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/03/25/Yeah-Baby!!-Revit-2011-API-e28093-the-unofficial-4th-Discipline.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=9bbc4afe-36d9-44ff-b2a3-6ba2d66e2eb5</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
  <media:credit role="author">Guy Robinson</media:credit><media:rating>nonadult</media:rating></channel>
</rss>
