<?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 1.4.5.10</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>Multi-core scaling of the Revit Database</title>
      <description>&lt;p&gt;On a fairly regular basis I’m asked questions along these lines:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;“We’ve been asking for multi-threaded Revit for years. How hard can it be? &amp;lt;Insert usual ADSK expletive&amp;gt;…”(1) &lt;/li&gt;    &lt;li&gt;“Why doesn’t Revit utilise all my PC’s cores like &amp;lt;insert application&amp;gt;…” &lt;/li&gt;    &lt;li&gt;“Revit isn’t a real database, and it’s slow according to our DB expert…(2)” &lt;/li&gt;    &lt;li&gt;“If ArchiCAD can use multiple cores then there should be no reason Revit can’t do it.(3)” &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;These questions and &lt;a href="http://www.geeky-gadgets.com/intel-announces-48-core-processor-for-cloud-computing-03-12-2009/"&gt;Intel’s press release on their 48 core processor&lt;/a&gt; has prompted this post in an attempt to explain why I believe it is a difficult Software engineering project to make Revit performance scale with multiple cores.(4)&lt;/p&gt;  &lt;p&gt;Do I think we’ll get a measure of scaling eventually? Yes. But it will probably happen progressively and with caution.&lt;/p&gt;  &lt;h3&gt;What is a database?&lt;/h3&gt;  &lt;p&gt;I’ll leave it to &lt;a href="http://en.wikipedia.org/wiki/Database"&gt;Wikipedia&lt;/a&gt; to describe in detail. I’m going to deliberately try and explain the problem without using computer science . However ;-), to set the scene…&lt;/p&gt;  &lt;p&gt;Simplistically, a database comprises 2 major areas of functionality. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Transactional Storage&lt;/strong&gt;. The &lt;a href="http://en.wikipedia.org/wiki/ACID"&gt;ACID&lt;/a&gt; properties of the distributed Revit database and other aspects of database storage I don’t intend to discuss.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Querying&lt;/strong&gt;. This is the aspect of the Revit database that effects the user experience the most when it comes to performance. Querying is used by an application for reading and writing/ updating of a database. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It is the querying of the Revit database I’m going to discuss in this post.&lt;/p&gt;  &lt;h3&gt;Setting the scene&lt;/h3&gt;  &lt;p&gt;All the features Revit users take for granted such as :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A window moving with it’s host wall when the wall is moved. &lt;/li&gt;    &lt;li&gt;A wall locked to a grid moving with the location change of the grid. &lt;/li&gt;    &lt;li&gt;A view title on a sheet updating when the view is renamed &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;They all are based around a single principle of a defined &lt;strong&gt;&lt;em&gt;relationship&lt;/em&gt;&lt;/strong&gt;. Take for example a window hosted by a wall. This can be represented as such:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/7658A8C8/RevitRel.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="RevitRel" border="0" alt="RevitRel" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/1B75F335/RevitRel_thumb.png" width="244" height="90" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Keep this in mind as I build up a picture of the problem Autodesk have with querying the Revit database with a multi-core architecture.&lt;/p&gt;  &lt;h4&gt;Doing some work&lt;/h4&gt;  &lt;p&gt;Say you have some work to do. There are 5 discreet tasks that can be represented as follows:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/1A9D8D4B/FiveTasks.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FiveTasks" border="0" alt="FiveTasks" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/63E03246/FiveTasks_thumb.png" width="244" height="187" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;At the moment you are on your own, so you start with one and after finishing that you move onto the next one. But it’s too slow. The boss wants to speed things up so he brings in more people to each do a discreet task (5):&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/2984BC65/FiveTasksFiveWorker.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FiveTasksFiveWorker" border="0" alt="FiveTasksFiveWorker" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/6363D984/FiveTasksFiveWorker_thumb.png" width="244" height="182" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The boss is happy but he notes four of the workers are sitting there twiddling their thumbs waiting for the slowest task to finish so they can go home. So he splits that slow task up into discreet subtasks and gives the other workers one subtask each to do:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/6FF186A0/FiveTasksSubFiveWorker.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FiveTasksSubFiveWorker" border="0" alt="FiveTasksSubFiveWorker" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/4DB97B1A/FiveTasksSubFiveWorker_thumb.png" width="244" height="166" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There’s some extra work required combining the discreet subtasks back together in a coordinated way which costs some time but overall the tasks are all completed in considerably less time.(6) Everyone goes home happy…&lt;/p&gt;  &lt;h4&gt;The Revit taskforce&lt;/h4&gt;  &lt;p&gt;The boss gives the workers some new tasks. However, these tasks are no longer discreet, each task depends on some aspect of another task:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/1E1B5C8E/FievRelTasks.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FievRelTasks" border="0" alt="FievRelTasks" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/050F667C/FievRelTasks_thumb.png" width="244" height="174" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In other words each task has a &lt;strong&gt;&lt;em&gt;relationship&lt;/em&gt;&lt;/strong&gt; to another task.&lt;/p&gt;  &lt;p&gt;So no task can be completed independently by a worker without coordinating and communicating with another worker. This coordinating takes planning,time, and a task may not be completed if the dependent task fails. More critically, throwing more workers at the tasks may not have the desired effect because they’ll spend more time communicating than doing any work on the task. &lt;/p&gt;  &lt;p&gt;This in a nutshell is the problem for Autodesk with Revit. Except it looks more like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/75F887A1/RevitTF.jpg" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RevitTF" border="0" alt="RevitTF" src="http://www.redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MulticorescalingofRevit/22911BAE/RevitTF_thumb.jpg" width="202" height="144" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Each task has multiple relationships to other tasks . So where do Autodesk start when throwing more workers at the tasks? Critically you don’t want to be doing a task more than once. And some tasks will be a priority in some contexts and not others. Revit has to manage this and work out the best route to finishing updating a project as quickly as possible. Put simply this is a massive mathematical and computer science project on many levels.&lt;/p&gt;  &lt;p&gt;Do Autodesk have the resources to solve this problem? Yes.&lt;/p&gt;  &lt;p&gt;Will they succeed? Sure. &lt;/p&gt;  &lt;p&gt;Will it happen overnight? I doubt it. &lt;/p&gt;  &lt;p&gt;Will they achieve a linear scaling of performance for n-cores? No, for reasons that I described above.&lt;/p&gt;  &lt;p&gt;So the next time someone asks, I hope this post goes someway to helping you explain why it’s so difficult for Autodesk to scale Revit for multi-core CPU architecture.&lt;/p&gt;  &lt;h4&gt;Notes:&lt;/h4&gt;  &lt;p&gt;(1) Revit is multi-threaded but it doesn’t scale linearly with multi-cores across all areas of functionality. Some functionality and rendering will use multiple cores but the improvement will be barely noticeable for now ( with the exception of rendering). &lt;/p&gt;  &lt;p&gt;(2) Revit is not built on a relational database object model. More like a object database model with some similarities to source code systems like CVS for replicating changes.&lt;/p&gt;  &lt;p&gt;(3) The details would take another post but I don’t consider archiCAD a true BIM application. It took Revit for people to realise Buildings were designed by multi-disciplined teams and therefore a &lt;strong&gt;coordinated&lt;/strong&gt; Building model for &lt;strong&gt;ALL disciplines&lt;/strong&gt; would be the game changer that we now think of as BIM. One of the core differences between Revit and archiCAD can be explained by the principles discussed in this post.&lt;/p&gt;  &lt;p&gt;(4) I have no access to the source code (obviously), I have had no discussions with the factory on this post. But I think I have an understanding of the issues they’re facing. &lt;/p&gt;  &lt;p&gt;If you’re part of the DB team in the factory, please don’t laugh too loudly ;-)&lt;/p&gt;  &lt;p&gt;(5) This is equivalent to raytrace rendering, video encoding etc where each thread can handle a discreet task and therefore you get close to n-core scaling.&lt;/p&gt;  &lt;p&gt;(6) Simplistically this is what we get now with some aspects of Revit functionality.&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/02/01/multi-core-scaling-of-the-Revit-Database.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2010/02/01/multi-core-scaling-of-the-Revit-Database.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=46a812c6-970c-4494-9eb6-f165f9cdfad3</guid>
      <pubDate>Mon, 01 Feb 2010 13:40:26 +1300</pubDate>
      <category>General</category>
      <category>Comment</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=46a812c6-970c-4494-9eb6-f165f9cdfad3</pingback:target>
      <slash:comments>11</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=46a812c6-970c-4494-9eb6-f165f9cdfad3</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/02/01/multi-core-scaling-of-the-Revit-Database.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=46a812c6-970c-4494-9eb6-f165f9cdfad3</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Happy New Year – Custom Ribbon Tabs Complete</title>
      <description>&lt;p&gt;As anyone who tried the Christmas ribbon solution would have found, it lacked one feature. The ability to handle context switching between standard projects and families. Changing to the other project type would cause the custom ribbon tab to disappear. There are a number of approaches to handling this context switching. &lt;/p&gt;  &lt;p&gt;Brian left a comment on the original post and others contacted me privately to highlight the problem and ask how it can be solved. To make it easier for people I’ve updated the RibbonService class to automatically handle the context switching as per standard behaviour. Hopefully this will also help those coding a more customised solution. &lt;/p&gt;  &lt;p&gt;Using the updated RibbonService requires one additional line to bind Revit’s ControlledApplication object to the RibbonService as follows:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IExternalApplication.Result OnStartup(ControlledApplication application)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          &lt;span style="color: #008000"&gt;// Create User tab and get a revit panel&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          RibbonService.BindControlledApplication(application);&lt;span style="color: #008000"&gt;// additional line required&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          var tab = RibbonService.CreateTab(&lt;span style="color: #006080"&gt;&amp;quot;RED_ID&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Merry Christmas&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;          var panel = RibbonService.CreatePanel(tab, &lt;span style="color: #006080"&gt;&amp;quot;Presents&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Note I updated the namespaces so you’ll have to update your Revit.ini accordingly.Source and binary can be downloaded &lt;a href="http://redbolts.com/blog/page/Downloads.aspx" target="_blank"&gt;here&lt;/a&gt; . Enjoy!!&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2010/01/08/Happy-New-Year-e28093-Custom-Ribbon-Tabs-Complete.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2010/01/08/Happy-New-Year-e28093-Custom-Ribbon-Tabs-Complete.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=7bb3efcf-614f-452f-a730-5b82b0eac169</guid>
      <pubDate>Fri, 08 Jan 2010 13:30:44 +1300</pubDate>
      <category>Ribbon</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=7bb3efcf-614f-452f-a730-5b82b0eac169</pingback:target>
      <slash:comments>17</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=7bb3efcf-614f-452f-a730-5b82b0eac169</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2010/01/08/Happy-New-Year-e28093-Custom-Ribbon-Tabs-Complete.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=7bb3efcf-614f-452f-a730-5b82b0eac169</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Merry Christmas – Ribbons,tabs and Panels</title>
      <description>&lt;p&gt;It’s that time of the year, so why not finish with a post on what has probably been the most controversial aspect of the Revit 2010 release, the ribbon.  In general I’ve stayed clear of UI customisation because I’d prefer Autodesk get it right. However, for API users the ability to add a tab for their own commands has been on the wishlist since the ribbon went live. Jeremy talked about it &lt;a href="http://thebuildingcoder.typepad.com/blog/2009/12/custom-ribbon-tab.html" target="_blank"&gt;here&lt;/a&gt; with the limitation you couldn’t run API commands. &lt;/p&gt;  &lt;p&gt;Using a little smoke and mirrors it is possible however to run API commands. The key is creating a Revit ribbon panel not a base Autodesk panel. This then allows you to use all the standard constructs for creating buttons and therefore running API commands when the button is clicked.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MerryChristmasRibbonstabsandPanels_CE70/Merry%20Christmas_4.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="Merry Christmas" border="0" alt="Merry Christmas" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/MerryChristmasRibbonstabsandPanels_CE70/Merry%20Christmas_thumb_1.png" width="244" height="59" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The code is very similar to creating buttons using the standard API’s.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IExternalApplication.Result OnStartup(ControlledApplication application)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #008000"&gt;// Create User tab and get a revit panel&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                var tab = RibbonService.CreateTab(&lt;span style="color: #006080"&gt;&amp;quot;RED_ID&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Merry Christmas&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                var panel = RibbonService.CreatePanel(tab, &lt;span style="color: #006080"&gt;&amp;quot;Presents&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                ...&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;RibbonService.CreateTab(…) creates your custom tab. You then add a Revit panel to this tab using RibbonService.CreatePanel(…) . Once you have the panel you can add buttons as per the standard API.&lt;/p&gt;

&lt;p&gt;Although this is using standard API’s and has been reliable for sometime now, in publishing this code I need to add the standard disclaimers:&lt;/p&gt;

&lt;p&gt;If it crashes/ corrupts your projects it’s not my fault.&lt;/p&gt;

&lt;p&gt;If you have problems using this code don’t expect Autodesk to support it.&lt;/p&gt;

&lt;p&gt;If it causes your computer to catch fire, it’s not my fault.&lt;/p&gt;

&lt;p&gt;If it causes your partner to attack your car with a golf club leading to you crashing into a tree, it’s not my fault or anything to do with my code or Autodesk’s ;-)&lt;/p&gt;

&lt;p&gt;I’d also add, don’t abuse this. If Autodesk start seeing every person and their dog adding a tab for 1 or 2 commands they’ll have good justification to shut this down. I see this only been used by inhouse developers wanting to create a company tab or 3rd party developers with numerous commands which they want to aggregate on a single tab.&lt;/p&gt;

&lt;p&gt;Source and binary &lt;a href="http://redbolts.com/blog/page/Downloads.aspx" target="_blank"&gt;here&lt;/a&gt; , enjoy!! Merry Christmas and a happy new year. 2010 is going to be a great year to be a Revit user I think…&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/12/21/Merry-Christmas-e28093-Ribbonstabs-and-Panels.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/12/21/Merry-Christmas-e28093-Ribbonstabs-and-Panels.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=cb247816-e8d6-423f-b760-befabc6440ad</guid>
      <pubDate>Mon, 21 Dec 2009 14:53:46 +1300</pubDate>
      <category>Ribbon</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=cb247816-e8d6-423f-b760-befabc6440ad</pingback:target>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=cb247816-e8d6-423f-b760-befabc6440ad</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/12/21/Merry-Christmas-e28093-Ribbonstabs-and-Panels.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=cb247816-e8d6-423f-b760-befabc6440ad</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Doing it all in Families</title>
      <description>&lt;p&gt;is not always the correct approach.&lt;/p&gt;  &lt;p&gt;It’s been too long since my last post. My blogging time has been occupied by more personal projects, some of which I’ll post about soon (famous last words ;-) ). &lt;/p&gt;  &lt;p&gt;I’m always keen to hear from people pushing Revit. In this case the person has immense knowledge of the Revit family editor and some knowledge but no real experience of the API. As required in their jurisdiction, when scheduling windows and doors they have to schedule areas of natural light. These exclude frames and mullions and have to be a percentage of the room area. In other words the visible glazing area per room. Here is the schedule in the test project. Glazing area is just the windows width*height. Natural light area is the glass area and Percent Natural light is (Natural light area/ room area)%.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/FamiliesandtheAPI_A368/Schedule_2.jpg"&gt;&lt;img title="Schedule" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="230" alt="Schedule" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/FamiliesandtheAPI_A368/Schedule_thumb.jpg" width="480" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The first issue they faced is you can’t schedule room area in door and window schedules. Strange, because you can schedule volume but using this and relying on unbounded height to get the area is not a reliable solution. So this is having to be manually entered. AAGH!!!!&lt;/p&gt;  &lt;p&gt;The second issue and really the basis for this post is that of calculating the area of natural light. Their solution was to add reference planes and width/height parameters to the window family to define each extrusion representing the areas of glass. And then use these values from the width/height parameters to sum the areas of glazing. Straightforward, except when the window in question looks like this:&lt;/p&gt;  &lt;p&gt;&lt;img title="Window image - from which latest calcs came" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="338" alt="Window image - from which latest calcs came" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/FamiliesandtheAPI_A368/Window%20image%20-%20from%20which%20latest%20calcs%20came_3.jpg" width="367" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;This resulted in 25 parameters and an ungodly array of formulae. I totally understand why they have taken this approach. For many the API is like a foreign language and so they have to push the family editor to achieve the desired result. They’ve used best practice techniques for building families and on the face of it , it all looks good. However, this is so not the path BIM and Revit should be taking you down. &lt;/p&gt;  &lt;h3&gt;Oh dear…&lt;/h3&gt;  &lt;p&gt;From a Revit development perspective it shows how much there is left to do with the family approach to component creation and management. From an API perspective it shows how inaccessible it is for most, particularly when it is a much better tool for the job as in this situation. Developing and testing this family has been a lot of work, and that’s just the one family. For every different style of window they’re going to have to repeat the process.&lt;/p&gt;  &lt;p&gt;Here are the main issues as I see it are:&lt;/p&gt;  &lt;p&gt;1.. 25 parameters in one family is a serious documentation and maintenance issue in one family. In a whole series of window families it’s a potential nightmare as you are repeating the formulae in every different family. It also has the potential to be a performance hit in a project of any size.&lt;/p&gt;  &lt;p&gt;2.. Yes you could use nesting, but it doesn’t really help much. You still need to aggregate the areas, and you still have the maintenance issues. &lt;/p&gt;  &lt;p&gt;3.. Every window series that is different requires a new array of formulae. There is a high risk of someone changing a formula in one family and not updating all associated families. What if you want to use the window in a different jurisdiction and a possibly different approach to calculating the area of natural light? Localisation becomes a problem.&lt;/p&gt;  &lt;p&gt;4.. &lt;strong&gt;Code compliance analysis has no place in Revit families&lt;/strong&gt;. Natural light calculations are not specific to the design of the window but rather a generic rule applied to all windows in a project. In software programming this is referred to as &lt;a href="http://en.wikipedia.org/wiki/Separation_of_concerns" target="_blank"&gt;separation of concerns&lt;/a&gt;. Applying/adding or modification of compliance rules should not require touching the Revit family at all in an ideal world.&lt;/p&gt;  &lt;h3&gt;The API approach&lt;/h3&gt;  &lt;p&gt;So how can the API help? &lt;/p&gt;  &lt;p&gt;The first thing to do is automate the room area updates. Next is to remove the requirement for customising window families to calculate glazing areas. We can use the API to automatically calculate the natural light areas (glass) from the family geometry. This obviously changes with family type so we need to account for this.&lt;/p&gt;  &lt;p&gt;Find attached a 2010 Revit project with a VSTA document macro embedded which does all this. In a production situation I’d use a standard API command, but for this prototype a VSTA macro is adequate.&lt;/p&gt;  &lt;p&gt;The approach I’ve taken is to extract the area of glass from the extrusion for the types used in the project. To do this we need to know which geometry is glazing. We could have used the material but they tend to vary within projects and families can have multiple glass materials in one family. Instead the macro looks for extrusions with a glass subcategory. &lt;/p&gt;  &lt;p&gt;To get at this subcategory requires editing the family as category isn’t exposed by getting the windows instance geometry in the project.So this is a 2010 project or above. Not the fastest approach but adequate as the parameters vary by window type only. You’d only need to run the macro whenever :&lt;/p&gt;  &lt;p&gt;1.. A new window type is used in a project.&lt;/p&gt;  &lt;p&gt;2.. The width/height of the window type change. &lt;/p&gt;  &lt;p&gt;3.. The room area changes. (This update could be a separate command)&lt;/p&gt;  &lt;p&gt;To get the actual glazed area in a family type we check for extrusions which have a subcategory equal to ‘glass’&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.Category.Name == &lt;span style="color: #006080"&gt;&amp;quot;Glass&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        var GeomM = e.get_Geometry(_geomOption);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var img &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; GeomM.Objects)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            var ss = img &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; Solid;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            var fc = ss.Faces[0];                                  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            nlArea += fc.Area;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Not a very robust solution for production but good enough to show the point. The beauty of this approach is it works for round or unusual shaped windows without any complexity being added to the family to calculate the area. The issues as prototyped include:&lt;/p&gt;

&lt;p&gt;1.. Faces[0] assumes the extrusion has been built in elevation.&lt;/p&gt;

&lt;p&gt;2.. the modelled boundaries of the glazing can’t extend into the window frame or mullions. Or the areas will be wrong.&lt;/p&gt;

&lt;p&gt;3.. It assumes only one glazing subcategory. Probably ok in most situations.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I’ve documented the code but if there are any questions please add a comment.&lt;/p&gt;

&lt;div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:eccde2ed-797c-4414-b561-73e72b83f45c" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;p&gt;Revit Project : &lt;a href="http://redbolts.com/blog/file.axd?file=WindowsLiveWriter/FamiliesandtheAPI_A368/Natural%20Lighting%20Calculations.rvt" target="_blank"&gt;Natural Lighting Calculations.rvt&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description>
      <link>http://redbolts.com/blog/post/2009/10/08/Doing-it-all-in-Families.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/10/08/Doing-it-all-in-Families.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=f51daa6d-f737-44a4-9c31-505884ec3a08</guid>
      <pubDate>Thu, 08 Oct 2009 16:23:14 +1300</pubDate>
      <category>Families</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=f51daa6d-f737-44a4-9c31-505884ec3a08</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=f51daa6d-f737-44a4-9c31-505884ec3a08</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/10/08/Doing-it-all-in-Families.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=f51daa6d-f737-44a4-9c31-505884ec3a08</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator><enclosure url="http://redbolts.com/blog/file.axd?file=WindowsLiveWriter/FamiliesandtheAPI_A368/Natural%20Lighting%20Calculations.rvt" length="1019904" type="application/octet-stream" /><media:content url="http://redbolts.com/blog/file.axd?file=WindowsLiveWriter/FamiliesandtheAPI_A368/Natural%20Lighting%20Calculations.rvt" fileSize="1019904" type="application/octet-stream" /></item>
    <item>
      <title>Debugging Commands in Revit 2010</title>
      <description>&lt;p&gt;Before I cover debugging… It &lt;a href="http://architechure.blogspot.com/2009/06/nein-nein-nein-nein-nein-nein-nein.html" target="_blank"&gt;looks like&lt;/a&gt; the classic UI is still with us. While this is encouraging as a short term solution and not totally surprising, I can’t see it being in Revit 2011 or above. With the API they’ll have to put back the toolbar code. Which means 3rd party developers will have to accommodate both solutions (ribbons, toolbars). Bit of a mess but then again so is the ribbon and I’m sure there will be many happy customers if they give us a choice until the &lt;strike&gt;mess&lt;/strike&gt;ribbon is fixed.&lt;/p&gt;  &lt;h2&gt;Debugging in Revit 2010&lt;/h2&gt;  &lt;p&gt;I noticed from &lt;a href="http://revit-programmer.blogspot.com/2009/06/edit-and-continue-in-revit-2010.html" target="_blank"&gt;Ed’s post&lt;/a&gt; that he’s having problems debugging in 2010. There is nothing worse than having to continually restart Revit when editing standard API commands. Especially if you’re trying to test against a large project. And personally I never liked edit-continue as a solution, particularly if you’re a TDD/ R# fan.&lt;/p&gt;  &lt;p&gt;There’s better but more complex solutions but here is a simple approach that allows you to quickly get up and running. The basis of the solution is running your code as a macro. To do this you have to target RevitProxy rather than RevitAPI. The Factory has been good enough to maintain the same namespaces between the 2 libraries. With the following exceptions. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;You can’t implement IExternalCommand.&lt;/li&gt;    &lt;li&gt;Generics aren’t supported so get_Elements(Filter, ICollection&amp;lt;T&amp;gt;) won’t compile. &lt;/li&gt;    &lt;li&gt;No implement ribbon related methods.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So to use this technique you have to provide a certain level of code separation which isn’t a bad thing.&lt;/p&gt;  &lt;p&gt;I’ve &lt;a href="http://redbolts.com/blog/page/Downloads.aspx" target="_blank"&gt;uploaded&lt;/a&gt; a test VS Project and a macro showing how to use it as a Document macro. To do a build/Run cycle if you modify this code you’re have to re-reference the project assembly in the VS project. The project just tests a simple utility class that counts the number of walls. So to debug using this approach. Modify and compile your&amp;#160; assemblies in Visual Studio. Now recompile the macro in VSTA and debug from VSTA. Not ideal but better than nothing.&lt;/p&gt;  &lt;p&gt;So how to use this technique?&lt;/p&gt;  &lt;p&gt;Create your project referencing the RevitAPI assembly as normal. Now create a second project in the same solution . This is the assembly that will be used in the macro and subsequent debugging. &lt;/p&gt;  &lt;p&gt;In this second project add a reference to the RevitProxy assembly.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/RevitProxyRef_2.png" rel="lightbox"&gt;&lt;img title="RevitProxyRef" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="126" alt="RevitProxyRef" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/RevitProxyRef_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Create your classes in the standard API project. Then the crux of this approach is mirroring these classes in the RevitProxy project. To do this go to the RevitProxy project and add the class by adding it as an existing item:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/AddExistingItem_2.png" rel="lightbox"&gt;&lt;img title="AddExistingItem" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="162" alt="AddExistingItem" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/AddExistingItem_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then reference the file as a link rather than copying the file.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/AddingAsLink_2.png" rel="lightbox"&gt;&lt;img title="AddingAsLink" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="170" alt="AddingAsLink" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/AddingAsLink_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So what you should end up with is 2 projects that mirror the same classes you wish to debug.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/CompleteProjects_2.png" rel="lightbox"&gt;&lt;img title="CompleteProjects" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="178" alt="CompleteProjects" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/CompleteProjects_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now fire up Revit 2010 and create a macro. Add a reference to the RevitProxy referenced assembly and implement the relevant code using your classes as you would in a RevitAPI command. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/VSTAProject_2.png" rel="lightbox"&gt;&lt;img title="VSTAProject" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="141" alt="VSTAProject" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/DebuggingCommandsinRevit2010_14BAE/VSTAProject_thumb.png" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/06/12/Debugging-Commands-in-Revit-2010.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/06/12/Debugging-Commands-in-Revit-2010.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=9be8778d-521d-4ee9-93d2-c380bb06bed5</guid>
      <pubDate>Fri, 12 Jun 2009 16:31:00 +1300</pubDate>
      <category>RevitAPI</category>
      <category>Ribbon</category>
      <category>Comment</category>
      <category>Tools</category>
      <category>Debugging</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=9be8778d-521d-4ee9-93d2-c380bb06bed5</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=9be8778d-521d-4ee9-93d2-c380bb06bed5</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/06/12/Debugging-Commands-in-Revit-2010.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=9be8778d-521d-4ee9-93d2-c380bb06bed5</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Grow up Autodesk…</title>
      <description>&lt;p&gt;&amp;#160;&lt;a href="http://architechure.blogspot.com/2009/05/your-regularly-scheduled-programming.html" target="_blank"&gt;How incredibly childish&lt;/a&gt; Autodesk. A very experienced AU speaker and organiser dropped because he had the audacity to question decisions… &lt;/p&gt;  &lt;p&gt;Thank you though, it makes my comments in &lt;a href="http://redbolts.com/blog/post/2009/05/07/Revit-2011-the-most-significant-release-EVER.aspx" target="_blank"&gt;this post&lt;/a&gt; all the more pertinent. Looks like the headless chickens are still out of their cages…&lt;/p&gt;  &lt;p&gt;For Phil I have one word, &lt;a href="http://www.youtube.com/watch?v=O-Y3AsZ19Hc" target="_blank"&gt;bugger&lt;/a&gt;…&lt;/p&gt;  &lt;p&gt;Maybe everyone just needs a holiday ;-) &lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/05/07/Grow-up-Autodeske280a6.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/05/07/Grow-up-Autodeske280a6.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=7415f04f-3727-4201-b39c-933b2a4dd26a</guid>
      <pubDate>Thu, 07 May 2009 16:40:43 +1300</pubDate>
      <category>Comment</category>
      <category>General</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=7415f04f-3727-4201-b39c-933b2a4dd26a</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=7415f04f-3727-4201-b39c-933b2a4dd26a</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/05/07/Grow-up-Autodeske280a6.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=7415f04f-3727-4201-b39c-933b2a4dd26a</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Revit 2011 - the most significant release EVER</title>
      <description>&lt;p&gt;Yes I have taken my medication and no, I have no crystal ball or prior knowledge ;-) I’ve generally stayed out of the debate over the ribbon UI in Revit 2010. However, &lt;a href="http://insidethefactory.typepad.com/my_weblog/2009/04/a-message-from-the-autodesk-building-industry-director-about-the-revit-2010-release.html" target="_blank"&gt;this post&lt;/a&gt; says too much about Revit development within Autodesk to go unchallenged. No, I’m not saying &lt;em&gt;“if they don’t fix the ribbon in Revit 2011 the world will end”&lt;/em&gt;. The issues I’m going to discuss are considerably more fundamental than that…&lt;/p&gt;  &lt;p&gt; Nicolas is right when he said the old UI was not scalable to support future functionality. In particular, if and when they produce a &lt;a href="http://revitoped.blogspot.com/2008/09/revit-building-or-revit-sweet-survey.html" target="_blank"&gt;single building modelling application&lt;/a&gt; a ribbon could be a useful tool in presenting discipline contextual UI’s from a single application. &lt;/p&gt;  &lt;p&gt;What got me with the whole ribbon debate was the result didn’t reflect the rigorous approach to software engineering we know they employ. So what went wrong? Well I think Nicolas provides the answer:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;“””We’ve also heard that the most significant barriers to Revit adoption are the availability of trained users and the cost of training new users.”””&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;“””For these reasons, our focus in developing a new user interface for Revit was on the creation of an extensible UI framework that is easier to learn and to use.”””&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I’ll rewrite this to what I think he’s really saying: &lt;/p&gt;  &lt;p&gt;&lt;em&gt;“””Attracting new subscribers to Revit was more important than supporting current subscribers. The very subscribers who want an UI that increased productivity and who PAID for it’s development.”””&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Nicolas’s statement is a concern on so many levels.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;I don’t believe the Factory would have suggested this as a reason for implementing the ribbon as we have it in Revit 2010. Therefore did Autodesk Marketing and Management (AMM) make this a directive as &lt;a href="http://architechure.blogspot.com/2009/04/humpty-dumpty-sat-on-a-wall.html" target="_blank"&gt;Phil suggested&lt;/a&gt;? AMM have NO place in product design. Their role is to guide, not define product design, especially when they don’t understand the current product. &lt;/li&gt;    &lt;li&gt;The lack of available trained Revit users can be largely attributed to the incredible rate of Revit adoption within the industry (&amp;gt;350,000) and until recently everyone has been very busy so unemployed trained users were rare. The high rate of adoption also suggests the old UI wasn’t a significant issue for most users. So a new UI shouldn’t have been a high priority and the old UI was very very good for a traditional UI.&lt;/li&gt;    &lt;li&gt;On a purely functional level, in my experience training users to document projects to a reasonable level of competence with Revit is considerably faster than any other CAD application . Particularly in comparison with AutoCAD. The difficulty in training new users is communicating and managing the disruptive workflow changes a successful Revit implementation generates and communicating the principles of BIM. Hence the importance of everyone from the top down within a firm being on the same wavelength, something &lt;a href="http://redbolts.com/blog/post/2008/12/05/A-Round-table-discussion-Ummmme280a6.aspx" target="_blank"&gt;Autodesk could learn from&lt;/a&gt;. IMO, Autodesk have done little to help firms in this area. A new poorly implemented UI won’t help here. &lt;/li&gt;    &lt;li&gt;BIM , and in particular IPD are currently at a very dynamic stage of implementation within firms. Best practice techniques are changing all the time particularly with large projects in multi-discipline teams. This requires a considerable amount of discussion, experimentation and training not centred around the BIM application itself but the disruptive workflow associated with BIM and IPD. A new UI that is counterproductive to implementing this workflow does not make for happy firms. As &lt;a href="http://forums.augi.com/poll.php?do=showresults&amp;amp;pollid=1660" target="_blank"&gt;this survey&lt;/a&gt; suggests. So the cost of training for the current implementation of the UI will be considerably higher than it might have been had they got it right. &lt;/li&gt;    &lt;li&gt;To use Revit effectively you need to understand how buildings are constructed. A scary number of CAD users don’t. This can be an impediment to using Revit correctly and also contributes to a shortage of trained users. IPD will help here, a new poorly implemented UI won’t. &lt;/li&gt;    &lt;li&gt;Why do Autodesk Marketing and Management (AMM) have so little faith in Revit as a platform that they have to dumb the UI down to attract new users? Let the product designers and engineers within the Factory inspire us with well designed new functionality rather than trying to create the lowest common dominator amongst all Autodesk’s CAD applications. Revit is a blank sheet of paper new platform, let it sing. If firms don’t GET Revit then frankly tough, that’s life and those firms that do will reap the benefits. A new poorly implemented UI won’t help these firms anyway. &lt;/li&gt;    &lt;li&gt;The difficulty in moving between Revit and AutoCAD is not the UI it’s the workflow differences in documenting a project using either application. The UI has little to do with it. Because an increasing number of firms have moved to 100% of project documentation with Revit this is even less important. For many, AutoCAD is becoming a legacy application limited to acting as a pipe to consultants not yet on the Revit platform. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Revit 2010&lt;/h3&gt;  &lt;p&gt;Enough about the UI, Nicolas has a lot more to say :&lt;/p&gt;  &lt;p&gt;&lt;em&gt;“””In addition to the new UI, the 2010 release of Revit has some very important enhancements.&amp;#160; &amp;lt;snip&amp;gt; Other non-visible investments in the platform…”””&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;These paragraphs are the understatement of the year. &lt;/p&gt;  &lt;p&gt;If you look at the structure of the dll’s in the Revit 2010 program directory compared with say Revit 2008 you’ll see a nice orderly structure. There has clearly been a lot of refactoring of the platform in the last few releases. Taking CurtainGridFamily’s for example, there are now 4 dll’s associated with this functionality. These are:&lt;/p&gt;  &lt;p&gt;CurtainGridFamilyDB.dll, CurtainGridFamilyMFC.dll, CurtainGridFamilyUI.dll, CurtainGridFamilyResENU.dll&lt;/p&gt;  &lt;p&gt;Guessing I’d say:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;**DB contains code directly relating to how curtaingrid’s are stored in the Revit database. &lt;/li&gt;    &lt;li&gt;**MFC or microsoft Foundation Classes contain specific code related to how curtaingrids interact with the database, other Revit objects and maybe Display related code (how the grids display in the UI with DirectX) or event handling. &lt;/li&gt;    &lt;li&gt;**UI contain code related to how functionality is displayed and how the user interacts with grids. Such as grid settings etc. &lt;/li&gt;    &lt;li&gt;**ResENU this contains resources for language specific items. Text strings in dialogs, etc. This will be different for each language release of Revit. However the remaining dll’s will be EXACTLY the same. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;What’s does this and the new building at Trepelo Road mean for end users? Well taking a stab at it I think we can make the following conclusions.&lt;/p&gt;  &lt;p&gt;This explains the relative dearth of new functionality since Revit 2008 because this would have tied up a considerable resource, as well as the best developers in the Factory. &lt;/p&gt;  &lt;p&gt;Revit 2010 and the move to DirectX accelerated graphics represents the completion of an overhaul of the Revit platform by a now significantly expanded team at the Factory (Revit.com was approx. 25 developers I think). This overhaul will provide the Factory with many advantages in their approach to software engineering and product design. Including at the very least:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The Revit platform now has all the infrastructure in place to allow a significantly faster rate of development than we have been seeing in the last 3 releases while maintaining a stable , easily managed code base. Revit application stability being a high point currently. &lt;/li&gt;    &lt;li&gt;Autodesk can protect it’s IP because not every developer needs to understand how Revit works at the database level. So they can throw more developers at Revit features without worrying if they’re going to run off to Bentley. &lt;/li&gt;    &lt;li&gt;Code separation allows individual features to be developed with less impact on the rest of the application. This should help reduce testing and improve code quality. &lt;/li&gt;    &lt;li&gt;The guru’s who work on the database can be left alone to research the big ticket items (WAN, n-core scaling etc) while the rest of the team works on adding new functionality oblivious to how that data is stored. Likewise UI experts can concentrate on the UI. Happy productive teams… &lt;/li&gt;    &lt;li&gt;UI design could be discipline/ geographically unique while the backend code remains the same stable tested platform. UI changes can be made quickly without massive testing of the backend (hint: ribbon). &lt;/li&gt;    &lt;li&gt;A &lt;a href="http://revitoped.blogspot.com/2008/09/revit-building-or-revit-sweet-survey.html" target="_blank"&gt;single building modelling application&lt;/a&gt; with discipline specific analysis extensions is SO SO achievable now it’s got to be a given. It’s just when… If you think Revit will be just Arch/Struct/MEP in future then I think you’re dreaming. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;All in all the next few releases should be an exciting time for Revit users. So why will the 2011 release be so significant?&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The whole UI debacle in Revit 2010 as discussed above and how they respond. &lt;/li&gt;    &lt;li&gt;The Factory is now a much larger team, new members (as I understand it) have largely come from the ADT team given that product is on it’s last legs. IMO though ADT is a piece of crap. I hope they are open to a new platform and understand what Revit should represent and this has been communicated. Not what some myopic AMM’s think a Autodesk BIM product should be or how it worked in AutoCAD. And this new team is given the independence to make and justify their decisions without AMM rocking the boat as they clearly seem to have with the ribbon. &lt;/li&gt;    &lt;li&gt;The Factory is now a much larger team. Communication within teams will be more difficult. Ensuring Revit remains a cohesive BIM application that inspires users with new functionality that is not just ports of AutoCAD or ADT principles will be a difficult task. One that won’t be helped if AMM don’t understand the product or philosophy. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;On many levels Revit 2010 can be thought of as the first major Autodesk release of Revit. There is probably not a line of code now that hasn’t been touched by Autodesk developers within this new platform. The next major release will be the first indications of whether this new platform and team is delivering. It’s a credit to the team though that the transition has gone so smoothly to date.&lt;/p&gt;  &lt;p&gt;Certainly the process will be dynamic and the team will make mistakes but IMO the ribbon implementation was not a good first step. And if you want a clear indication that this team can get it right? Just look at the new API calls in Revit 2010. The Factory was undoubtedly left alone to define their product as they saw fit and they delivered.&lt;/p&gt;  &lt;h3&gt;What needs to happen?&lt;/h3&gt;  &lt;p&gt;Hopefully Autodesk Marketing and Management (AMM) don’t panic. This statement from Nicolas is concerning:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;“””We’re already planning for ways to incorporate the current wish list items in the next release of Revit.”””&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Well isn’t that a given… shouldn’t that have been happening ALL the time? The very presence of his post and the new email alias also suggests they’re panicking somewhat. The worst result for Revit 2011 would be AMM run around like headless chickens and force the Factory to make the priority for Revit 2011 quantity over quality of new features. &lt;/p&gt;  &lt;p&gt;There is a good argument to suggest what is needed next is a few easily implemented long standing requests and a considerable amount of work going into fixing the pages of issues with current functionality that has been ignored since their inception. However for a AMM that likes big ticket candy this is a harder sell to the shareholder and press.&lt;/p&gt;  &lt;h3&gt;Conclusion&lt;/h3&gt;  &lt;p&gt;Revit currently, remains the only released building modelling application both within Autodesk or externally, that has any hope of realising the promise of BIM and IPD that all the powerpoints from AMM suggest is possible, and the building industry dreams of.&amp;#160; &lt;/p&gt;  &lt;p&gt;From my discussions with people in the Factory, and from stellar releases such as the Revit 2010 API enhancements its clear at least at the micro level they have the ability and platform to deliver the goods. However, it’s also clear from debacles such as the Revit 2010 ribbon UI implementation that at the macro level there is still much that needs to change within Autodesk and their approach to Revit product development.&lt;/p&gt;  &lt;p&gt;Current users of Revit just need to wait and hope they let the factory do their job. &lt;/p&gt;  &lt;p&gt;So it’s for these reasons and what we get with the release of Autodesk Revit 2011 that will tell us whether anything has changed, and why it will be the most significant release of Revit EVER…&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/05/07/Revit-2011-the-most-significant-release-EVER.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/05/07/Revit-2011-the-most-significant-release-EVER.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=7ffa3821-194b-417b-90c1-9606404cf464</guid>
      <pubDate>Thu, 07 May 2009 01:25:17 +1300</pubDate>
      <category>Autodesk Revit</category>
      <category>General</category>
      <category>Comment</category>
      <category>Ribbon</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=7ffa3821-194b-417b-90c1-9606404cf464</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=7ffa3821-194b-417b-90c1-9606404cf464</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/05/07/Revit-2011-the-most-significant-release-EVER.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=7ffa3821-194b-417b-90c1-9606404cf464</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Restarting…</title>
      <description>&lt;p&gt;Thanks for the concern from those that were worried ;-) I haven’t disappeared off the face of the earth. Very busy and school holidays in Wanaka.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Back_9709/WanakaPano_2.jpg" rel="lightbox"&gt;&lt;img title="WanakaPano" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="33" alt="WanakaPano" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Back_9709/WanakaPano_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then very nasty stomach bug went slowly through our whole household. Normal transmissions about to restart…&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/05/06/Restartinge280a6.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/05/06/Restartinge280a6.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=a82d383d-46a9-4036-a574-85df018146be</guid>
      <pubDate>Wed, 06 May 2009 12:47:02 +1300</pubDate>
      <category>Comment</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=a82d383d-46a9-4036-a574-85df018146be</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=a82d383d-46a9-4036-a574-85df018146be</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/05/06/Restartinge280a6.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=a82d383d-46a9-4036-a574-85df018146be</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>A significant milestone</title>
      <description>&lt;p&gt;After a considerable amount of work I’ve finally managed to complete what is by far my most significant Revit API command to date. In trying to figure out what would attract AutoCAD users to Revit I hit upon what I consider to be the missing link. This command will also be very useful for Revit experts.&lt;/p&gt;  &lt;p&gt;Utilising JAVA for crossplatform support, OpenGl, .NET, WCF, AJAX, WPF, REST and a little bit of a cloud database platform I’ve implemented a distributed natural language commandline for Revit. That’s right a commandline for Revit!!! Here’s a screen shot:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Asignificantmilestone_DA11/NLCommandLine_4.jpg" rel="lightbox"&gt;&lt;img title="NLCommandLine" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="147" alt="NLCommandLine" src="http://redbolts.com/blog/image.axd?picture=WindowsLiveWriter/Asignificantmilestone_DA11/NLCommandLine_thumb_1.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The Revit 2009 application is &lt;a href="http://redbolts.com/blog/page/Downloads.aspx" target="_blank"&gt;here&lt;/a&gt;. All assemblies must be in the same directory. Note it’s a command application not an external command and it adds a Redbolts menu rather than adding an entry to external tools. And sorry no source code for this one. The intellisense has a bug at the moment so you’ll have to get the syntax of your queries right. I’m just so excited I couldn’t wait to get this out for you to try. Here’s some examples of syntax and some queries to try.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Please return all walls with width &amp;lt; 4000mm&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Please sum all window areas on level 1&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Please return all rooms with external doors&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;You must start a query with please , I needed a trigger string for a query and this seemed a polite option;-)&lt;/p&gt;  &lt;p&gt;Enjoy, and any questions please leave a message or send me an email.&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/04/01/A-significant-milestone.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/04/01/A-significant-milestone.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=f27d3fea-3cad-468d-bb66-68dfe8e0ed22</guid>
      <pubDate>Wed, 01 Apr 2009 17:07:38 +1300</pubDate>
      <category>CommandLine</category>
      <category>Autodesk Revit</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=f27d3fea-3cad-468d-bb66-68dfe8e0ed22</pingback:target>
      <slash:comments>7</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=f27d3fea-3cad-468d-bb66-68dfe8e0ed22</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/04/01/A-significant-milestone.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=f27d3fea-3cad-468d-bb66-68dfe8e0ed22</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
    <item>
      <title>Load() that command please?–User settings Part 4</title>
      <description>&lt;p&gt;As I explained in &lt;a href="http://redbolts.com/blog/post/2009/03/19/Where-art-thou-API-Command-e28093-User-settings-Part-3.aspx" target="_blank"&gt;part 3&lt;/a&gt; if a command fails to run other than in the Revit executable directory, there is a good chance it’s because of the command assembly was loaded into the wrong binding context (LoadFrom() ) by Revit. In this part of the series I’m going to explain how we can fix this so you can place a command in any directory..&lt;/p&gt;  &lt;p&gt; When an Appdomain tries to load an assembly it first looks in the GAC and the directory defined by it’s ApplicationBase property. Normally this is the directory of the executable and this is the case for Revit. You can also add subdirectories of the ApplicationBase directory, by setting the privateBinPath via the AppDomainSetup and the Domain manager will look there as well. Unfortunately this can’t be set once Revit has started so how do we make the Revit AppDomain load our command assemblies into the correct binding context?&lt;/p&gt;  &lt;p&gt;I should also add, you may additionally require &lt;a href="http://blogs.msdn.com/shawnfa/archive/2004/12/30/344554.aspx" target="_blank"&gt;FullTrust&lt;/a&gt; if the command is loaded from a network path&lt;/p&gt;  &lt;p&gt;Every AppDomain has by definition one configuration file. In our case this will be &lt;em&gt;Revit.exe.config&lt;/em&gt; which resides in the Revit executable directory .In Revit 2009 you need to create this yourself, in the executable directory. In Revit 2010 it is already created because Autodesk are configuring a CAS setting for the CLR. You’ll see from the documentation on the &lt;a href="http://msdn.microsoft.com/en-us/library/1fk1t1t0.aspx" target="_blank"&gt;configuration schema&lt;/a&gt; and in particular the &lt;a href="http://msdn.microsoft.com/en-us/library/0kk0kk35.aspx" target="_blank"&gt;runtime schema&lt;/a&gt; that there are 2 solutions that allow us to ensure our commands are loaded correctly by the Revit AppDomain.&lt;/p&gt;  &lt;h3&gt;Probing Solution&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/823z9h8w.aspx" target="_blank"&gt;Probing&lt;/a&gt; will add subdirectories to the PrivateBinPath, ensuring any command assembly in these subdirectories will be probed correctly and load in the Load() context . Paths can only be subdirectories of the Revit program path not full paths outside of the ApplicationBase directory. &lt;/p&gt;  &lt;p&gt;&amp;#160; The advantage of this solution is it very easy to configure. It’s great for development, as long as you place the command assembly in a configured subdirectory the command will load into the correct binding context. The disadvantage is it won’t work if you want to place your command assembly on the network.&lt;/p&gt;  &lt;p&gt; The following is an example Revit.exe.config file. In this example we’re defining 2 subdirectories to be added for probing. For a default XP installation the full paths to these directories would be :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;C:\Program Files\Revit Architecture 2009\Program\Extensions&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;C:\Program Files\Revit Architecture 2009\Program\Extensions\Dev&lt;/em&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;lt;?xml version=&lt;span style="color: #006080"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span style="color: #006080"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt; ?&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;configuration&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &amp;lt;runtime&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        &amp;lt;assemblyBinding xmlns=&lt;span style="color: #006080"&gt;&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            &amp;lt;probing privatePath=&lt;span style="color: #006080"&gt;&amp;quot;Extensions\;Extensions\Dev;&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        &amp;lt;/assemblyBinding&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &amp;lt;/runtime&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;/configuration&amp;gt; &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Note all subdirectories need to be defined by separating paths with semi-colons (;)&lt;/p&gt;

&lt;h3&gt;CodeBase solution&lt;/h3&gt;

&lt;p&gt;This solution is the most exact but also requires the most configuration. You must provide the complete &lt;a href="http://msdn.microsoft.com/en-us/library/efs781xb.aspx" target="_blank"&gt;codebase&lt;/a&gt; for the assembly in question. This is most useful when you want to store command assemblies anywhere on the network. The assemblies full Identity must be included or this solution will not work. It is not enough to just provide the codebase. The full path and version of the assembly is provided and at a minimum the assembly's name. The following is an example Revit.exe.config:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;lt;configuration&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    &amp;lt;runtime&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;        &amp;lt;assemblyBinding xmlns=&lt;span style="color: #006080"&gt;&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;            &amp;lt;dependentAssembly&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;                &amp;lt;assemblyIdentity name=&lt;span style="color: #006080"&gt;&amp;quot;MyCommand&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;                &amp;lt;codeBase version=&lt;span style="color: #006080"&gt;&amp;quot;1.0.0.0&amp;quot;&lt;/span&gt; href=&lt;span style="color: #006080"&gt;&amp;quot;FILE://C:/2009Commands/MyCommand.dll&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;            &amp;lt;/dependentAssembly&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;        &amp;lt;/assemblyBinding&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &amp;lt;/runtime&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Note the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The format of the href with the FILE prefix as per standard URI’s.&lt;/li&gt;

  &lt;li&gt;You must add an assembly binding entry for each command assembly you want to load. &lt;/li&gt;

  &lt;li&gt;If you version your assemblies then the version property of the binding must be updated accordingly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;For both solutions you must add these AppDomain configuration settings to the Revit.exe.config file not your commands app.config file.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So that’s how we can use any .NET assembly in our commands. Now we know how to do this I can complete the series by explaining how to implement a fully featured configuration solution in your commands.&lt;/p&gt;</description>
      <link>http://redbolts.com/blog/post/2009/03/27/Load()-that-command-please-e28093-User-settings-Part-4.aspx</link>
      
      <comments>http://redbolts.com/blog/post/2009/03/27/Load()-that-command-please-e28093-User-settings-Part-4.aspx#comment</comments>
      <guid>http://redbolts.com/blog/post.aspx?id=c016e9f7-a988-4b3f-9efb-4dab0419d5ca</guid>
      <pubDate>Fri, 27 Mar 2009 15:04:07 +1300</pubDate>
      <category>Autodesk Revit</category>
      <category>Configuration</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=c016e9f7-a988-4b3f-9efb-4dab0419d5ca</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://redbolts.com/blog/trackback.axd?id=c016e9f7-a988-4b3f-9efb-4dab0419d5ca</trackback:ping>
      <wfw:comment>http://redbolts.com/blog/post/2009/03/27/Load()-that-command-please-e28093-User-settings-Part-4.aspx#comment</wfw:comment>
      <wfw:commentRss>http://redbolts.com/blog/syndication.axd?post=c016e9f7-a988-4b3f-9efb-4dab0419d5ca</wfw:commentRss>
    <dc:creator>Guy Robinson</dc:creator></item>
  <media:credit role="author">Guy Robinson</media:credit><media:rating>nonadult</media:rating></channel>
</rss>
