<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0YGQn86cCp7ImA9WhBaFkQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738</id><updated>2013-05-28T09:58:43.118+10:00</updated><category term="mobile" /><category term="Indexing" /><category term="2009" /><category term="AU2010" /><category term="SQL" /><category term="Outlook" /><category term="Fxcop" /><category term="printing" /><category term="Windows" /><category term="delay" /><category term="Synergy" /><category term="logitech" /><category term="Group Policy" /><category term="RIS" /><category term="I-Drop" /><category term="Flash" /><category term="Revit" /><category term="Design Review" /><category term="git" /><category term="Code-Style" /><category term="Revit-API" /><category term="Laptop" /><category term="Enhanced" /><category term="cordless" /><category term="OCR" /><category term="Status" /><category term="DSOFile" /><category term="Gaming" /><category term="SMS" /><category term="Hostname" /><category term="Custom Attributes" /><category term="bad" /><category term="General-IT" /><category term="JPEG" /><category term="Vista performance" /><category term="Netlimiter" /><category term="Blogger" /><category term="Word" /><category term="WSS" /><category term="Custom Forms" /><category term="ps2" /><category term="Entities" /><category term="Parameters" /><category term="web-forms" /><category term="Mouse" /><category term="HTML" /><category term="asp.net" /><category term="Scan" /><category term="nhibernate" /><category term="Vista" /><category term="Twitter" /><category term="Two" /><category term="Usability" /><category term="MVC" /><category term="javascript" /><category term="cache" /><category term="Exchange" /><category term="visual-studio" /><category term="cricket" /><category term=".Net" /><category term="Deployment" /><category term="Simple" /><category term="64bit" /><category term="web applications" /><category term="2003" /><category term="General-Dev" /><category term="life cycle" /><category term="Security" /><category term="SWF" /><category term="Keyboard" /><category term="Programming" /><category term="Configuration" /><category term="WDS" /><category term="KVM" /><category term="excel" /><category term="ios" /><category term="Caspol" /><category term="Multiple-Monitors" /><category term="Web Parts" /><category term="Office 2007" /><category term="Facebook" /><category term="Housekeeping" /><category term="database" /><category term="operating system" /><category term="Doc" /><category term="IE6" /><category term="Compatibility" /><category term="ajax" /><category term="2010" /><category term="Users Opinion" /><category term="files" /><category term="DWF" /><category term="Simple OCR" /><category term="Search" /><category term="API" /><category term="Autocad" /><category term="C#" /><category term="source" /><category term="EXE" /><category term="Revit-Server" /><category term="Registration" /><category term="Computers" /><category term="nuget" /><category term="wireless" /><category term="Sharepoint" /><category term="Click OK" /><category term="server" /><category term="Menus" /><category term="Vista BatchFiles" /><category term="data" /><category term="WPF" /><category term="COD4" /><title>Rod Howarth</title><subtitle type="html">blog.rodhowarth.com - Bits and pieces on software development and technology. </subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.rodhowarth.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>119</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/rodh257" /><feedburner:info uri="rodh257" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0EMQnc5fCp7ImA9WhBaFkQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-380212842632931077</id><published>2013-05-28T09:00:00.002+10:00</published><updated>2013-05-28T09:01:23.924+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-28T09:01:23.924+10:00</app:edited><title>Styling Two or More Fusion Tables Layers in Google Maps</title><content type="html">The Google Maps API has a feature called '&lt;a href="https://developers.google.com/maps/documentation/javascript/layers#FusionTables"&gt;Fusion Tables Layer&lt;/a&gt;' which lets you overlay data from a &lt;a href="http://www.google.com/drive/apps.html#fusiontables"&gt;Google Fusion Tables&lt;/a&gt;. Using this feature, you can upload some KML data into a Fusion Table and see it represented on the map (for example, you can highlight an area on a map to represent some sort of data). The Maps API has in built support for using KML directly, however KML files can get quite large for complex data, so using Fusion Tables is a high performance alternative (Google handles large data sets with ease) This is what my exmaple Fusion Table with KML data uploaded looks like:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Q0445_cjTpc/UaPk0jR-q3I/AAAAAAAAFgg/lLjBqc0AVII/s1600/Screen+Shot+2013-05-28+at+8.57.03+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-Q0445_cjTpc/UaPk0jR-q3I/AAAAAAAAFgg/lLjBqc0AVII/s320/Screen+Shot+2013-05-28+at+8.57.03+AM.png" width="228" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
You can display markers, polygons, and polylines on a layer and can style each of these as you wish using the options supplied to the API call. &lt;a href="https://developers.google.com/maps/documentation/javascript/examples/layer-fusiontables-styling"&gt;An example of the code to do this is available here.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
If you have multiple bits of data to show, you can add multiple layers from a range of different Fusion Tables. However, there is one limitation, which is pointed out in the documentation:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;span style="background-color: #efefef; color: #222222; font-family: Arial, sans-serif; font-size: 13px; line-height: 21px;"&gt;Styles can only be applied to a single Fusion Tables layer per map. You may apply up to five styles to that layer.&lt;/span&gt;&lt;/blockquote&gt;
I recently ran into this limitation when trying to overlay two separate (complex) data sets. For my use case, I wanted to show data from two different Fusion Tables with two different styles, which means I was out of luck. I tried a number of workarounds to avoid this (seemingly odd) limitation. I attempted to combine them into the one table, but the queries don't allow OR statements, &amp;nbsp;I then tried using my own KML file, however that came out larger than 1MB, which loaded very slowly, whereas the Fusion Tables layer handled that data with ease.&lt;br /&gt;
&lt;br /&gt;
I then attempted to add styling information to the KML file before uploading it into the Fusion Table interface (as KML supports this), however the upload process strips that information out. It was while searching for a way to get around this that I found the solution. I discovered that in the Fusion Tables interface you can add your own map, style it there, and it will give you code to easily embed it. This is designed to allow those without coding skills to style and embed a map on a blog or web page. Great! I thought, a bit annoying that I have to store that information in an external dependency instead of in my own code in source control, but at least I can solve this problem (I could perhaps use the Fusion Tables API to set this style from within my application, at the cost of a few HTTP requests).&lt;br /&gt;
&lt;br /&gt;
However when I went to find this map tab that &lt;a href="https://support.google.com/fusiontables/answer/185991?hl=en"&gt;the documentation&lt;/a&gt; mentions, it was greyed out...&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-_gMbrVl5koQ/UaPfW2fgwMI/AAAAAAAAFfg/grjJQi1Pdcg/s1600/Screen+Shot+2013-05-28+at+8.33.53+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="160" src="http://3.bp.blogspot.com/-_gMbrVl5koQ/UaPfW2fgwMI/AAAAAAAAFfg/grjJQi1Pdcg/s320/Screen+Shot+2013-05-28+at+8.33.53+AM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
There's no mention that I could easily find on the page explaining why it was greyed out, but I had a hunch. Given how terribly Google has dealt with Google Apps accounts, I figured that seeing as I was signed in with a Google Apps email, it might have something to do with that. Signing into my personal Gmail revealed that my hunch was indeed correct, I can add a map (you may need to give that account write permissions or copy the table to your personal account).&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-_FhIFSOcjd0/UaPgDHBDaqI/AAAAAAAAFfo/-8TXLbepMBE/s1600/Screen+Shot+2013-05-21+at+9.15.07+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="241" src="http://3.bp.blogspot.com/-_FhIFSOcjd0/UaPgDHBDaqI/AAAAAAAAFfo/-8TXLbepMBE/s320/Screen+Shot+2013-05-21+at+9.15.07+AM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
Sigh. Some searching uncovered &lt;a href="https://support.google.com/fusiontables/answer/1657096"&gt;some documentation on this&lt;/a&gt;. You have to submit a request to Google asking them to turn it on. Would be nice if they just mentioned this in the interface...&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
Once you've added a map, tools &amp;gt; change map styles will let you style it.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/-3Xm6UcgXbXc/UaPgyJQVLbI/AAAAAAAAFf4/UROvKaw5gu0/s1600/Screen+Shot+2013-05-28+at+8.39.45+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-3Xm6UcgXbXc/UaPgyJQVLbI/AAAAAAAAFf4/UROvKaw5gu0/s1600/Screen+Shot+2013-05-28+at+8.39.45+AM.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-Q-lnYGpAWf8/UaPg9tYZeZI/AAAAAAAAFgA/mSBe8_Rii28/s1600/Screen+Shot+2013-05-28+at+8.40.44+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="295" src="http://1.bp.blogspot.com/-Q-lnYGpAWf8/UaPg9tYZeZI/AAAAAAAAFgA/mSBe8_Rii28/s320/Screen+Shot+2013-05-28+at+8.40.44+AM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
You're note quite done yet though, simple embedding this table into the API won't do it, you need to tell the API which style and which template to use in your map. &lt;a href="https://developers.google.com/fusiontables/docs/v1/using#WorkingStyles"&gt;There's some documentation on getting the style number and setting it in the Maps API here&lt;/a&gt;. I couldn't find an easy way to get this Id from the API, but it's probably a small number if you just want to try numbers up from 1,2,3,4 etc. Next you need the template ID, which you can find by clicking on the map tab's dropdown and clicking publish. At the end of the URL the querystring will have the template ID as 'tmplt'.&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-oAsgstmiRYQ/UaPjt34tiKI/AAAAAAAAFgQ/owYCFm0yBRM/s1600/Screen+Shot+2013-05-28+at+8.52.05+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="217" src="http://3.bp.blogspot.com/-oAsgstmiRYQ/UaPjt34tiKI/AAAAAAAAFgQ/owYCFm0yBRM/s320/Screen+Shot+2013-05-28+at+8.52.05+AM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
You then pass these through in your maps API call like so:&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp;gridLayer = new googleMap.FusionTablesLayer({&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; query: {&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select: 'geometry',&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from: fusionTableId,&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; map: map,&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; templateId: 2,&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; styleId: 2,&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clickable: false&lt;/div&gt;
&lt;div class="separator" style="clear: both;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
You should them see your styled map embedded in your page. Simple... right?&lt;/div&gt;
&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/DQ7Id2MFelc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/380212842632931077/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=380212842632931077" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/380212842632931077?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/380212842632931077?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/DQ7Id2MFelc/styling-two-or-more-fusion-tables.html" title="Styling Two or More Fusion Tables Layers in Google Maps" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-Q0445_cjTpc/UaPk0jR-q3I/AAAAAAAAFgg/lLjBqc0AVII/s72-c/Screen+Shot+2013-05-28+at+8.57.03+AM.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2013/05/styling-two-or-more-fusion-tables.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4BSHY9eSp7ImA9WhJTGUo.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-236233781314727143</id><published>2012-06-29T23:20:00.000+10:00</published><updated>2012-06-29T23:35:59.861+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-29T23:35:59.861+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Code-Style" /><title>Using C# Named Parameters for Code Readability</title><content type="html">In C# 4.0, Microsoft introduced a feature called 'Named Parameters', which lets you refer to parameters in a method that you are calling in a syntax like this: &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MyMethod(firstParameter: firstValue, secondParameter: secondValue)&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;This lets you call the method with parameters in a different order, and also helps to facilitate optional parameters. Aside from these benefits, I've come to like using them to improve code clarity, particularly in unit tests. &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Lets say you have a method like this one:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;public decimal CalculateFuelCostPerKm(double kilometresTravelled, double litresInFuelTank, decimal costToFillTank) &lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;If you were to call that method, you might do something like this:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;CalculateCostPerKm(500D, 60D, 72.58M);&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;However if you are reading that and don't know the parameters, you're going to have to dive deeper to understand it. A way to improve it might be:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;var kilometresTravelled = 500D;&lt;br&gt;var litresInFuelTank = 60D;&lt;br&gt;var costToFillTank = 72.58M;&lt;br&gt;CalculateCostPerKm(kilometresTravelled, litresInFuelTank, costToFillTank);&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;Which is much clearer, but is a fair bit of effort. But with C# named parameters you can do this:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;CalculateCostPerKm(kilometresTravelled: 500D, litresInFuelTank: 60D, costToFillTank: 72.58M);&lt;/pre&gt;&lt;br&gt;Simple to do, and clear to read. In fact, this is probably one of the rare situations where C# being written &lt;/div&gt;
&lt;div&gt;more like Objective-C is a good thing. Take this example for creating an alert dialog in the iOS SDK:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt;- (id)initWithTitle:(&lt;/span&gt;&lt;a style="font-family: courier, consolas, monospace; color: #003366; font-size: 13px; text-decoration: none" href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/c_ref/NSString"&gt;NSString&lt;/a&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; *)&lt;/span&gt;&lt;em style="font-family: 'Lucida Grande', geneva, helvetica, arial, sans-serif; font-size: 13px"&gt;title&lt;/em&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; message:(&lt;/span&gt;&lt;a style="font-family: courier, consolas, monospace; color: #003366; font-size: 13px; text-decoration: none" href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/c_ref/NSString"&gt;NSString&lt;/a&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; *)&lt;/span&gt;&lt;em style="font-family: 'Lucida Grande', geneva, helvetica, arial, sans-serif; font-size: 13px"&gt;message&lt;/em&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; delegate:(id)&lt;/span&gt;&lt;em style="font-family: 'Lucida Grande', geneva, helvetica, arial, sans-serif; font-size: 13px"&gt;delegate&lt;/em&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; cancelButtonTitle:(&lt;/span&gt;&lt;a style="font-family: courier, consolas, monospace; color: #003366; font-size: 13px; text-decoration: none" href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/c_ref/NSString"&gt;NSString&lt;/a&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt;*)&lt;/span&gt;&lt;em style="font-family: 'Lucida Grande', geneva, helvetica, arial, sans-serif; font-size: 13px"&gt;cancelButtonTitle&lt;/em&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; otherButtonTitles:(&lt;/span&gt;&lt;a style="font-family: courier, consolas, monospace; color: #003366; font-size: 13px; text-decoration: none" href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/c_ref/NSString"&gt;NSString&lt;/a&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt; *)&lt;/span&gt;&lt;em style="font-family: 'Lucida Grande', geneva, helvetica, arial, sans-serif; font-size: 13px"&gt;otherButtonTitles,&lt;/em&gt;&lt;span style="font-family: courier, consolas, monospace; font-size: 13px"&gt;&amp;nbsp;&lt;/span&gt;&lt;em style="font-family: 'Lucida Grande', geneva, helvetica, arial, sans-serif; font-size: 13px"&gt;...&lt;/em&gt; &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Which you would call like:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;[[UIAlertView alloc] initWithTitle:&lt;span style="color: #006080"&gt;@"Error"&lt;/span&gt; message:&lt;span style="color: #006080"&gt;@"You stuffed up"&lt;/span&gt; delegate:self cancelButtonTitle:&lt;span style="color: #006080"&gt;@"OK"&lt;/span&gt; otherButtonTitles:nil];&lt;/pre&gt;&lt;br&gt;Or in C# you might do something like this (ignoring the delegate business):&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;UIAlertView.InitWithTitle(&lt;span style="color: #006080"&gt;"Error"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"You stuffed up"&lt;/span&gt;, myDelegate, &lt;span style="color: #006080"&gt;"OK"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;&lt;br&gt;As you can see, the verbose nature of Objective-C makes for clearer code in this instance, however, we could write the C# method like: &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;UIAlertView.InitWithTitle(title: &lt;span style="color: #006080"&gt;"Error"&lt;/span&gt;, message: &lt;span style="color: #006080"&gt;"You stuffed up"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;delegate&lt;/span&gt;: myDelegate, cancelButtonTitle: &lt;span style="color: #006080"&gt;"OK"&lt;/span&gt;, otherButtonTitles: &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;&lt;br&gt;Which makes it just as clear. &lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;I've found this technique particularly useful in unit tests, which often tend towards using constant values. For instance I might often have a method to setup a certain state in my stubs where I take in the important parameters required, this technique makes this much easier to read. &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;I’d love to hear your thoughts on this technique, either in the comments on this post or via &lt;a href="http://twitter.com/rodh257"&gt;Twitter (@rodh257)&lt;/a&gt;&lt;/div&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/mWbhkpNj0f0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/236233781314727143/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=236233781314727143" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/236233781314727143?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/236233781314727143?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/mWbhkpNj0f0/using-c-named-parameters-for-code.html" title="Using C# Named Parameters for Code Readability" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>9</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2012/06/using-c-named-parameters-for-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIMQ3Y-eCp7ImA9WhVaGU8.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-5702451355169625178</id><published>2012-06-17T18:09:00.000+10:00</published><updated>2012-06-17T18:09:42.850+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-17T18:09:42.850+10:00</app:edited><title>What's been happening?</title><content type="html">It's been a fair while since I last posted to this blog, so as I start lining up a few more blog posts I thought I'd make a quick post to let you know what I've been up to over the last 6 months. &lt;br /&gt;
&lt;br /&gt;
The last post I made was about &lt;a href="http://blog.rodhowarth.com/2011/11/at-last-years-autodesk-university.html"&gt;an experimental technique I'd created for running Revit API add-ins as scheduled tasks&lt;/a&gt;. This was a part of my &lt;a href="http://au.autodesk.com/?nd=class&amp;amp;session_id=9580"&gt;Autodesk University 2011 virtual presentation&lt;/a&gt;, which is online now. If you don't have access to the AU Online website I've uploaded the slides and handout and the &lt;a href="https://github.com/RodH257/RevitRemoteBoot"&gt;sample code for the Revit Remote Boot&lt;/a&gt;&amp;nbsp;and &lt;a href="https://github.com/RodH257/RevitServerHtmlAdmin"&gt;Html Server Admin&lt;/a&gt; are on Github. This was a pretty niche topic, but it was fun to dive into, and I hope people got some good use out of it. It's worth noting that &lt;a href="http://wikihelp.autodesk.com/enu?adskContextId=EXLINK_RS_OVERVIEW&amp;amp;product=REVIT&amp;amp;release=2013&amp;amp;language=enu"&gt;Revit Server 2013&lt;/a&gt; is now out, and makes a few changes which could affect this code (I'd be interested to hear if you were using this code).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://envoyat.com/"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-qCxR2JW6MhU/T91ENRB6OZI/AAAAAAAAB-A/0byY2azn5gU/s1600/envoyLogo+(1).gif" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
After this post was made I have started work with a new company, &lt;a href="http://envoyat.com/"&gt;Envoy Advanced Technologies&lt;/a&gt;. Envoy are an agile software development firm that primarily work on web-based business applications. This has given me the opportunity to work on some big software systems with some really brilliant developers using some great development techniques (as a shameless plug, if you're looking to have a software system developed, whether it&amp;nbsp;involves&amp;nbsp;Revit or not, you could do much worse than to get into contact with Envoy).&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img border="0" src="http://4.bp.blogspot.com/-kXMrhnUpTAY/T91E3M6asTI/AAAAAAAAB-Q/t52HV0htye0/s1600/rtcapp.PNG" /&gt;&lt;/div&gt;
Aside from the larger projects, I recently worked on the&lt;a href="http://www.rtcevents.com/blog/?p=270"&gt; iOS and mobile web apps&lt;/a&gt; for this years &lt;a href="http://rtcevents.com/"&gt;Revit Technology Conference&lt;/a&gt;. Envoy were a sponsor of RTC AUS and the USA version of the conference is starting in a couple of weeks time, if you haven't had a look yet I recommend you head to &lt;a href="http://revitconference.com.au/rtc2012us/index.htm"&gt;their website&lt;/a&gt; and look over the schedule. It looks to have some really good classes, including one on Revit Server.&lt;br /&gt;
&lt;br /&gt;
This change in employer has meant that I've not been working as much on Revit add-ins as I used to, hence the lack of posts on the topic. I am however still tinkering away with it in my spare time, and have a few ideas floating around my head for nifty ways to use the new &lt;a href="http://thebuildingcoder.typepad.com/blog/2012/03/revit-2013-and-its-api.html"&gt;2013 API features&lt;/a&gt;&amp;nbsp;which I hope to post about in the future.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://budurl.com/ConvoyiOS"&gt;&lt;img border="0" height="133" src="http://2.bp.blogspot.com/-2fns1X-0jyo/T91Hqu3IXoI/AAAAAAAAB-c/EWrhf4HwLYk/s320/convoy-logo@2x.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
In my spare time, I've released an update to &lt;a href="http://budurl.com/ConvoyiOS"&gt;Convoy&lt;/a&gt;, my iOS app to make it easier to communicate when travelling in a group of vehicles. Primarily it includes a graphics&amp;nbsp;overhaul which is thanks to &lt;a href="http://grixdesigns.wordpress.com/"&gt;Vanessa Grixti&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
This and other projects I've been working on are great as they give me the chance to dive into some product development/management, which is an interest of mine, I've been blogging about these sorts of topics over at &lt;a href="http://cejest.com/"&gt;Cejest&lt;/a&gt;, but I'm planning on moving those posts over to this blog.&lt;br /&gt;
&lt;br /&gt;
In addition to these posts, I'll be writing more about general software development topics, both technical (C#, ASP.NET MVC, iOS etc) and non-technical, including posts on workflows, development practices etc. A reminder that if you aren't interested in reading this, and just want Revit content, there's a link to a Revit topics only RSS feed on the right of the blogs main page.&lt;br /&gt;
&lt;br /&gt;
If you've got any feedback or questions feel free to&amp;nbsp;&lt;a href="mailto:mail@rodhowarth.com"&gt;email me (mail@rodhowarth.com)&lt;/a&gt; or &lt;a href="http://twitter.com/rodh257"&gt;ping me on twitter (@rodh257)&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/3bsNOO8DaLY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/5702451355169625178/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=5702451355169625178" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/5702451355169625178?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/5702451355169625178?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/3bsNOO8DaLY/whats-been-happening.html" title="What's been happening?" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-qCxR2JW6MhU/T91ENRB6OZI/AAAAAAAAB-A/0byY2azn5gU/s72-c/envoyLogo+(1).gif" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2012/06/whats-been-happening.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYMR3s8fip7ImA9WhVXE00.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-1152395977159309223</id><published>2011-11-15T17:43:00.001+10:00</published><updated>2012-04-13T17:29:46.576+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-13T17:29:46.576+10:00</app:edited><title>[Revit API]– Revit Remote Boot - A technique to run an API add-in on a particular Revit model without user interaction</title><content type="html">At last years Autodesk University, someone mentioned that they were looking for a way to run an export on their model once a day, on a schedule. This is not something that the Revit API is generally used for, but it&amp;nbsp; got me thinking of ways that I could make it happen. While flying around the USA after AU I hacked together some prototype code which did just this, but left it shelved. For my AU 2011 virtual class, I decided to finish it off and make it public, in case someone else wants to use it.&lt;br /&gt;
The program is called ‘Revit Remote Boot’, and is really more of a ‘system’ than a program, there are a number of moving parts to make it all happen. Put simply, it is a couple of interacting programs that allow you to perform an operation on a Revit model from a script. &lt;br /&gt;
Take a look at this video, which is a small part of my AU Virtual class, for a full demonstration of what it does. Note that while it talks about using Revit Server to create a local model, if you are running just a pure file server, this is fine as well – you could just directly open the file. It’s just that running Revit Server opens up some interesting possibilities and was the topic of my AU presentation. &lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="300" src="http://player.vimeo.com/video/32118121?title=0&amp;amp;byline=0&amp;amp;portrait=0" webkitallowfullscreen="webkitallowfullscreen" width="400"&gt;&lt;/iframe&gt;  &lt;br /&gt;
&lt;a href="http://vimeo.com/32118121"&gt;Revit Remote Boot Demonstration&lt;/a&gt; from &lt;a href="http://vimeo.com/user2797832"&gt;Rod Howarth&lt;/a&gt;&lt;br /&gt;
(you should head to &lt;a href="http://vimeo.com/32118121"&gt;the Vimeo page&lt;/a&gt; and watch it in high definition there to read the text)&lt;br /&gt;
Basically your application can save an xml file in a certain directory, which ads a ‘job’ to the queue. Then, using the RevitServerToolCommand, you can, from a batch file, create a local copy of the Revit Model you want to work on, and open it in Revit. From there, a Revit API add-in will detect that you’ve opened a model that corresponds to a job, and will run the &lt;i&gt;other&lt;/i&gt; Revit API add-in that was specified in the job file. After this is done, the job is marked complete, and Revit is closed. &lt;br /&gt;
In my example, I’ve done a simple export to DWF of the model, the idea being you could set this up to run at 1am every night, and export the DWF model to a certain location – perhaps for viewing in Design Review on mobile devices. However, you could use it for any Revit API add-in. For instance, you could have a high powered server which you setup as a local Revit Server just purely to run this Revit Remote Boot. On this server you could create a job to run a structural analysis add-in, or other computationally expensive stuff. This way you can setup your own “cloud”, running Revit directly. You could also run certain audits on a model, for example, you could create an add-in that counts the number of warnings present in the model and saves this to a database, for displaying in a ‘hall of shame’ on your company intranet. &lt;img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="http://lh3.ggpht.com/-62YhRvM0jKA/TsIYHrtG-eI/AAAAAAAAAgw/CedFE8AQz0I/wlEmoticon-smile%25255B2%25255D.png?imgmax=800" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;" /&gt;&lt;br /&gt;
This is highly experimental, and has some pitfalls, so should be considered as a proof of concept, rather than a production ready program. The main pitfall is that any errors that come up are shown as dialog boxes, and there is no easy way to deal with this in Revit. To get around this I’ve used AutoHotKey (&lt;a href="http://www.autohotkey.com/"&gt;http://www.autohotkey.com/&lt;/a&gt;) to detect certain dialogs and close them, but if there are unexpected ones, it will fall over. &lt;br /&gt;
If you are interested in the code behind this, check it out here: &lt;a href="https://github.com/RodH257/RevitRemoteBoot"&gt;https://github.com/RodH257/RevitRemoteBoot&lt;/a&gt; you can use the ‘zip’ button there to download it if you don’t have git. &lt;br /&gt;
I’d love to hear your thoughts on this, and whether you think Autodesk should work towards making this kind of thing easier to do? &lt;br /&gt;
&lt;a class="twitter-follow-button" data-show-count="false" data-size="large" href="https://twitter.com/rodh257"&gt;Follow @rodh257&lt;/a&gt;&lt;br /&gt;
&lt;script&gt;
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
&lt;/script&gt;&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/Z4Mya09ZXeA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/1152395977159309223/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=1152395977159309223" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/1152395977159309223?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/1152395977159309223?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/Z4Mya09ZXeA/at-last-years-autodesk-university.html" title="[Revit API]– Revit Remote Boot - A technique to run an API add-in on a particular Revit model without user interaction" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-62YhRvM0jKA/TsIYHrtG-eI/AAAAAAAAAgw/CedFE8AQz0I/s72-c/wlEmoticon-smile%25255B2%25255D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/11/at-last-years-autodesk-university.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8GSHk7cSp7ImA9WhNaF0Q.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-8925232471269294486</id><published>2011-11-05T00:28:00.001+10:00</published><updated>2013-02-02T18:13:49.709+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-02T18:13:49.709+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="General-Dev" /><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title>[General Dev]–How to push to two Git remote locations at once</title><content type="html">Now that &lt;a href="http://bitbucket.org/"&gt;BitBucket&lt;/a&gt; supports Git, I’ve been utilizing both &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt; and &lt;a href="http://bitbucket.org/"&gt;BitBucket&lt;/a&gt; for my project hosting, and have been looking into migrating to BitBucket for my private repositories (as they are free). This is part of the beauty of using a distributed version control system, you can have your code in multiple locations, rather than one central Subversion server. &lt;br /&gt;
In Git, I could add two remotes and each time I want to push/pull code I would type something like:&lt;br /&gt;
git push github master   &lt;br /&gt;git push bitbucket master&lt;br /&gt;
However, I want to make things as easy as possible for myself, and I’m simply using these two repositories as a mirror of each other, so I’ll be telling git to push to multiple URL’s with the same remote.&lt;br /&gt;
To do this, I need to edit the .git/config file for my project. You can navigate here via the command line, or in Windows you can turn on hidden file display and open the .git folder in Windows Explorer&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/-kc4ekkFMQ1c/TrPhjStI-GI/AAAAAAAAAeo/q80Yniiru2M/s1600-h/image%25255B11%25255D.png"&gt;&lt;img alt="image" border="0" height="245" src="http://lh3.ggpht.com/-lEIsYhRSM1k/TrPhkpOFdfI/AAAAAAAAAew/IqUvRRIZ2Tg/image_thumb%25255B5%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="502" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/-YCMzYZixU78/TrPhlvcAm3I/AAAAAAAAAe4/gFXF2Ktpw5A/s1600-h/image%25255B12%25255D.png"&gt;&lt;img alt="image" border="0" height="252" src="http://lh6.ggpht.com/-qKVShN2UmV4/TrPhmvYsizI/AAAAAAAAAfA/wJ1LjX2aj1U/image_thumb%25255B6%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="508" /&gt;&lt;/a&gt;&lt;br /&gt;
In this file, I’ve already added one of my remotes using the git remote add command, as you can see here:&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/-ENzIXT7mHAA/TrPhnvCj9mI/AAAAAAAAAfI/PYrHwKztCwM/s1600-h/image%25255B24%25255D.png"&gt;&lt;img alt="image" border="0" height="261" src="http://lh5.ggpht.com/-0kTZPaZxX9A/TrPhpNhB9zI/AAAAAAAAAfQ/45HkJr4dM8U/image_thumb%25255B12%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="522" /&gt;&lt;/a&gt;&lt;br /&gt;
To make it push to BitBucket at the same time as GitHub, you simply duplicate this URL line and add the BitBucket URL to it&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/-yHvgeOCpl1k/TrPhp_ZfGzI/AAAAAAAAAfY/Bc-VYFjqLoA/s1600-h/image%25255B28%25255D.png"&gt;&lt;img alt="image" border="0" height="261" src="http://lh4.ggpht.com/-V5zDTjQJk-A/TrPhrKmopaI/AAAAAAAAAfg/9lP_i0VFUmc/image_thumb%25255B14%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="522" /&gt;&lt;/a&gt;&lt;br /&gt;
Then if you do a git push origin master (where master is name of your branch), you will see it will push to these URLs in succession:&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/-8TquvoTb6yk/TrPhsHQyMaI/AAAAAAAAAfo/EBFp1HKQD0I/s1600-h/image%25255B32%25255D.png"&gt;&lt;img alt="image" border="0" height="239" src="http://lh4.ggpht.com/-gc0QPguhhWo/TrP2cijOjPI/AAAAAAAAAf4/AeWxMrhVbCw/image_thumb%25255B16%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="530" /&gt;&lt;/a&gt;&lt;br /&gt;
Unfortunately if you have a password protected ssh key it will still ask twice for your password.&lt;br /&gt;
Now each time you push to your origin remote, you’ll be taking full advantage of gits distributed nature, and will have two remote copies of your code.&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/HXTBjmaHefE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/8925232471269294486/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=8925232471269294486" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8925232471269294486?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8925232471269294486?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/HXTBjmaHefE/general-devhow-to-push-to-two-git.html" title="[General Dev]–How to push to two Git remote locations at once" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-lEIsYhRSM1k/TrPhkpOFdfI/AAAAAAAAAew/IqUvRRIZ2Tg/s72-c/image_thumb%25255B5%25255D.png?imgmax=800" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/11/general-devhow-to-push-to-two-git.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QDRnYycCp7ImA9WhdUFk0.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-2150497065721280681</id><published>2011-10-03T12:36:00.001+10:00</published><updated>2011-10-03T12:36:17.898+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-03T12:36:17.898+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit-Server" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit]– HTML Version of the Silverlight Revit Server Administrator Tool</title><content type="html">&lt;p&gt;If you’ve used Revit Server Before, you might recognize this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-BwsICbQSwmM/TokflfOrSoI/AAAAAAAAAeM/Leniz0nSGqI/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-d2C862C-cgU/TokfmfmDVBI/AAAAAAAAAeQ/vy4GF36B_jg/image_thumb%25255B1%25255D.png?imgmax=800" width="688" height="477" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It’s the Revit Server Administrator Tool which you access by going to &lt;a href="http://servername/revitserveradmin"&gt;http://servername/revitserveradmin&lt;/a&gt; it lets you see what Revit Server projects you have present, what files are stored in them, and their version history. It also lets you create, move, copy, delete or lock files and folders. &lt;/p&gt;  &lt;p&gt;It’s a vital tool for anyone who runs a Revit Server, and it generally works well, but it has one problem – it’s written in Silverlight. Whatever your opinion on Silverlight may be, it requires an extra installation and won’t run on any mobile devices. This is where the Revit Server API comes in. Using this REST API, I was able to recreate this website in HTML and Javascript. The result looks like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-M98Tw0ABSDw/TokfnGR9qvI/AAAAAAAAAeU/3gqjuywQ6fU/s1600-h/image%25255B13%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-9rsPWrqQeo8/TokfoL0mdjI/AAAAAAAAAeY/GuORhKNh3_A/image_thumb%25255B7%25255D.png?imgmax=800" width="728" height="560" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As my main motivation for this was to give the Revit Server REST API a run through, I’ve not made it absolutely the same, there are some minor visual and functional differences, but for the most part, it behaves in the same way. All of the action buttons are functional, you can see a submission history and folder structure. &lt;/p&gt;  &lt;p&gt;For the moment, the main limitations are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;When you create or paste a folder, the treeview on the left gets recreated and starts collapsed again. This is fixable, and if there is interest, I’ll polish this up (probably by replacing the treeview library with a new one)&lt;/li&gt;    &lt;li&gt;The submission history isn’t paged or sortable, its just a table with all the information in it. This should be fixable as well. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’m interested to hear if anyone is genuinely interested in using this tool in their environment, if so, I’ll keep improving it, if not, then it will serve as a demonstration of the Revit Server API’s capabilities, and will form a part of &lt;a href="http://blog.rodhowarth.com/2011/09/revit-autodesk-university-2011-virtual.html"&gt;my AU Virtual session&lt;/a&gt; this year.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The website is available &lt;/strong&gt;&lt;a href="https://github.com/RodH257/RevitServerHtmlAdmin"&gt;&lt;strong&gt;on Github&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, to install it on your server simply download the zip file from that site, and create a folder called ‘html’ in ‘C:\Program Files\Autodesk\Revit Server 2012\Sites\RevitServerAdmin’ on the machine you have Revit Server installed. Put all the files in there, and you should be able to navigate to &lt;/strong&gt;&lt;a href="http://localhost/RevitServeradmin/html/"&gt;&lt;strong&gt;http://localhost/RevitServeradmin/html/&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; to access it. &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;For those interested in the technical details, the page is simple HTML (it’s named Default.aspx even though it isn’t an ASP.NET web page, it’s named this way because this allows us to access it by going to /html/ instead of /html/default.htm), with a CSS stylesheet and some images to replicate the interface of the Silverlight tool. The real work happens in the RevitServer.js file, which, with the help of Jquery, calls the REST web service for each of the various actions that the user performs, and updates the DOM with the results. There is no server side ASP.NET code involved, it’s all Javascript with the Revit Server REST API doing the heavy lifting. &lt;/p&gt;  &lt;p&gt;Of course, if you want to use the Revit Server API, you don’t need to use Javascript, you could write a similar thing in C# or VB code and service up in an ASP.NET web page, or just about any language you like as long as they can make HTTP Requests. &lt;/p&gt;  &lt;p&gt;If you want to know more about how it all works, or more about the Revit Server API, I’ll be going into more detail in my &lt;a href="http://blog.rodhowarth.com/2011/09/revit-autodesk-university-2011-virtual.html"&gt;AU 2011 Virtual session&lt;/a&gt;. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/yoyeebEhsmQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/2150497065721280681/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=2150497065721280681" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2150497065721280681?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2150497065721280681?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/yoyeebEhsmQ/revit-html-version-of-silverlight-revit.html" title="[Revit]– HTML Version of the Silverlight Revit Server Administrator Tool" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-d2C862C-cgU/TokfmfmDVBI/AAAAAAAAAeQ/vy4GF36B_jg/s72-c/image_thumb%25255B1%25255D.png?imgmax=800" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/10/revit-html-version-of-silverlight-revit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEAR3cyeCp7ImA9WhdUE00.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-9006472877789102562</id><published>2011-09-30T01:04:00.001+10:00</published><updated>2011-09-30T01:04:06.990+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-30T01:04:06.990+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit-Server" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit Server]– How to get a listing of all Revit Server projects through the REST interface</title><content type="html">&lt;p&gt;I’ve been writing some code that utilizes the Revit Server REST API, and in particular, I’m working on a HTML replacement for the Revit Server Admin page, which is currently written in Silverlight. More details on that will come (and will be included in my &lt;a href="http://blog.rodhowarth.com/2011/09/revit-autodesk-university-2011-virtual.html"&gt;AU virtual class&lt;/a&gt;), but for now I ran into a bit of a stumbling block that others may encounter. &lt;/p&gt;  &lt;p&gt;The REST API has an endpoint that lets you list the contents of a certain folder. This endpoint requires a GET request to the path ‘/{folderpath}/contents’ with folderpath being the path of your folder, for example a request to ‘/My_Project/contents’ would list the contents of the My_Project folder. But how do you find out that there is a My_Project folder in the first place? You need to get a listing of all of the folders underneath the parent folder on the server, but how would you do that? You can’t send you request to ‘/contents’, as you are missing the folder path section, and thus it’s not a valid endpoint according to the API. I tried a number of different combinations of URL’s before I finally found one that seems to work.&lt;/p&gt;  &lt;p&gt;To get a listing of all the folders underneath the parent folder, send your GET request to:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;‘/ /contents’&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;That is, use a space instead of a folder path, like so:&lt;/p&gt;  &lt;p&gt;“&lt;a href="http://localhost/RevitServerAdminRESTService/AdminRESTService.svc/"&gt;http://localhost/RevitServerAdminRESTService/AdminRESTService.svc/&lt;/a&gt; /contents” &lt;/p&gt;  &lt;p&gt;This will be treated as if it is the root folder, and will list the folders underneath that. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/D5KkXQlDxiA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/9006472877789102562/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=9006472877789102562" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/9006472877789102562?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/9006472877789102562?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/D5KkXQlDxiA/revit-server-how-to-get-listing-of-all.html" title="[Revit Server]– How to get a listing of all Revit Server projects through the REST interface" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/09/revit-server-how-to-get-listing-of-all.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUERnY6cSp7ImA9WhdUE00.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-2354881841635437238</id><published>2011-09-30T00:56:00.001+10:00</published><updated>2011-09-30T00:56:47.819+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-30T00:56:47.819+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit]– Autodesk University 2011 Virtual Class: Automating Autodesk Revit Server</title><content type="html">&lt;p&gt;The Autodesk University conference in Las Vegas is approaching us once again. I’ve had the great privilege of presenting at this event for the past two years on topics concerning the Revit API. At this stage it doesn’t look like I’ll be making the trip from Australia this year to attend the physical conference, but that hasn’t stopped me from being involved virtually! I’ve been accepted to present a class on “&lt;a href="http://au.autodesk.com/?nd=event_class&amp;amp;session_id=9580&amp;amp;jid=1747607"&gt;Automating Autodesk Revit Server&lt;/a&gt;”.&amp;#160; Here is the class description:&lt;/p&gt;  &lt;h3&gt;Class Description&lt;/h3&gt;  &lt;p&gt;The latest version of Revit Server offers a number of automation capabilities, from locking files and creating directories to generating a new local file for a Revit central model. This class will explore these options and consider some scenarios where they can be leveraged along with existing Microsoft® Windows® and Revit APIs to perform time-saving tasks. A number of examples will be showcased, including how to create a HTML replacement for the Silverlight® admin tool, how to create a Revit Server folder from an existing system, and how it is possible to have a scheduled task that runs once a day, creates a local file, opens it, and exports the model to a DWF™ without user interaction.&lt;/p&gt;  &lt;h3&gt;Key Learning&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;Explain how Revit server automation can be integrated into existing software processes &lt;/li&gt;    &lt;li&gt;Describe the REST interface to Revit Server &lt;/li&gt;    &lt;li&gt;Combine the Revit Server command line and the Revit API to perform a task in a Revit model on a schedule &lt;/li&gt;    &lt;li&gt;Use the supplied command line utilities to automate Revit Server&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The idea for this class came about when I was playing around with Revit Server and noticed that there is a document on the REST API in the Revit SDK. I had a few ideas for interesting things to do with this API, and Revit Server in general, and what better motivation to put them into action than the pressure of presenting an AU class on the topic :) &lt;/p&gt;  &lt;p&gt;Virtual classes only go for 45 minutes, so the code will mostly be read through and explained rather than written live, but I’ll have a bunch of code available for download and in the handout. &lt;/p&gt;  &lt;p&gt;If you are interested in Revit Server, be sure to check it out! If you aren’t, but are interested in Revit API development, check out the &lt;a href="http://thebuildingcoder.typepad.com/blog/2011/09/revit-and-aec-api-classes-at-autodesk-university.html"&gt;various other Revit API classes&lt;/a&gt; that will be a part of the event, the Revit API team have once again put together a great curriculum to help you get as much API knowledge as you can out of AU. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/8cGKw99_3UY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/2354881841635437238/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=2354881841635437238" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2354881841635437238?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2354881841635437238?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/8cGKw99_3UY/revit-autodesk-university-2011-virtual.html" title="[Revit]– Autodesk University 2011 Virtual Class: Automating Autodesk Revit Server" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/09/revit-autodesk-university-2011-virtual.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EEQX46cCp7ImA9WhdQGUQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-8186409858969838243</id><published>2011-08-22T15:37:00.002+10:00</published><updated>2011-08-22T15:40:00.018+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-22T15:40:00.018+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit API]–How to create an installer for your Revit Addins</title><content type="html">Often I see Revit API utilities distributed with instructions to copy manifest files around and put the files in a certain directory (I’ve done it myself in the past), which works fine, but there is a more user friendly way of setting up your addins. You can use Visual Studios ‘Setup Project’ functions to create an installer, which isn’t the pretties installer going around, but it gets the job done. &lt;br /&gt;
Doing this is a little harder than you’d think, there’s a few gotchas, so this post aims to step you through it. &lt;br /&gt;
Add a new project to your solution, under ‘Other Project Types’, ‘Setup and Deployment’ choose ‘Setup Project’.&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/-JQpQ0ocZ6nU/TlHqyhirLZI/AAAAAAAAAdE/gQ9M-CBox9U/s1600-h/image%25255B50%25255D.png"&gt;&lt;img alt="image" border="0" height="419" src="http://lh6.ggpht.com/-nWDBnla_e2Q/TlHqznES3jI/AAAAAAAAAdI/EgnNvb1I6GQ/image_thumb%25255B30%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="604" /&gt;&lt;/a&gt;&lt;br /&gt;
You’ll see a view like this, delete ‘Users Desktop’, ‘User Programs Menu’&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/-Qvedl6BpyUU/TlHq0vEx3MI/AAAAAAAAAdM/3AX2XMpmzmE/s1600-h/image%25255B49%25255D.png"&gt;&lt;img alt="image" border="0" height="615" src="http://lh3.ggpht.com/-LtHRzJWmBtg/TlHq1oxjZnI/AAAAAAAAAdQ/nhBbz65Na8I/image_thumb%25255B29%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="605" /&gt;&lt;/a&gt;&lt;br /&gt;
Right click on Application folder and go to add &amp;gt; project output. Choose the Addin project.&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/-oUCYd2igzpE/TlHq2VPkARI/AAAAAAAAAdU/bGP-3P1AnKU/s1600-h/image%25255B30%25255D.png"&gt;&lt;img alt="image" border="0" height="361" src="http://lh6.ggpht.com/-CrqaE9EL_aA/TlHq3G9kufI/AAAAAAAAAdY/Od186oc3MLk/image_thumb%25255B16%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="313" /&gt;&lt;/a&gt;&lt;br /&gt;
Right click on application folder again, go to properties and change the DefaultLocation to be:&lt;br /&gt;
&lt;em&gt;[ProgramFiles64Folder][Manufacturer]\[ProductName] &lt;/em&gt;&lt;br /&gt;
This is so that it will always be in a consistent install location, rather than program files (x86). &lt;br /&gt;
Now, we don’t want to distribute RevitAPI and RevitAPIUI dlls, so in the solution explorer, expand detected dependencies and right click on those and click exclude.&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/-qomA72fUmwQ/TlHq4f-uhpI/AAAAAAAAAdc/7lNmPhGmAqw/s1600-h/image%25255B48%25255D.png"&gt;&lt;img alt="image" border="0" height="386" src="http://lh5.ggpht.com/-NYUSknOH8uI/TlHq5IpLelI/AAAAAAAAAdg/-s2o-quXE38/image_thumb%25255B28%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="624" /&gt;&lt;/a&gt;&lt;br /&gt;
Click on the installer project, then click the properties tab, and set the ‘Manufacturer’ and ‘ProductName’ to match your company/addin name. Also, while you are here, change the ‘TargetPlatform’ to X64. Unfortunately with these types of installers you need a separate install for X86 and X64, but I think most of you will be building API addins for X64 systems, as Revit generally needs at least 4gb of RAM, and if you are enough of a power user to be installing add-ins, you are going to be running a 64bit operating system I’m sure. But keep in mind that it may vary for you. &lt;br /&gt;
We need to create a .addin manifest file that points to the program files folder as follows, make sure you generate a new GUID. &lt;br /&gt;
&amp;lt;RevitAddIns&amp;gt;   &lt;br /&gt;&amp;nbsp; &amp;lt;AddIn Type="Command"&amp;gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Text&amp;gt;My Revit Util&amp;lt;/Text&amp;gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Assembly&amp;gt;C:\Program Files\COMPANY NAME\PRODUCT NAME\Addin.dll&amp;lt;/Assembly&amp;gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;AddInId&amp;gt;18520534-3ee1-473e-ae97-a68dfbda3754&amp;lt;/AddInId&amp;gt;    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FullClassName&amp;gt;MyRevitUtil.Command&amp;lt;/FullClassName&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;VendorId&amp;gt;COMP&amp;nbsp;&amp;lt;/VendorId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;VendorDescription&amp;gt;MY COMPANY&amp;nbsp;&amp;lt;/VendorDescription&amp;gt;&amp;nbsp;&amp;nbsp;   &lt;br /&gt;&amp;nbsp; &amp;lt;/AddIn&amp;gt;    &lt;br /&gt;&amp;lt;/RevitAddIns&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In The primary output screen, add a new custom folder, called Autodesk Addins. Right click on it and go to properties and set the DefaultLocation to&lt;br /&gt;
&lt;em&gt;[CommonAppDataFolder]\Autodesk\Revit\Addins\2012&lt;/em&gt;&lt;br /&gt;
and Property to AUTODESKADDINS&lt;br /&gt;
This will install it for all users. Right click in the middle panel and go to add file, and choose your manifest. &lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/-JKlzF7v11yk/TlHq6QTlssI/AAAAAAAAAdk/5QYla7Wjqoc/s1600-h/image%25255B47%25255D.png"&gt;&lt;img alt="image" border="0" height="571" src="http://lh4.ggpht.com/-fpzzKx6AjjY/TlHq7QzFnbI/AAAAAAAAAdo/9AQr2hn3YS4/image_thumb%25255B27%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="598" /&gt;&lt;/a&gt;&lt;br /&gt;
At this point you’re almost done, there’s just a couple of .NET settings to tweak. First of all, we don’t need to bundle an installer for .NET framework as Revit installs it by default, so right click on your installer project, go to properties and hit prerequisites&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/-kY-7XxDnFqk/TlHq8CyBObI/AAAAAAAAAds/4w-vpB2PNH0/s1600-h/image%25255B46%25255D.png"&gt;&lt;img alt="image" border="0" height="426" src="http://lh3.ggpht.com/-XBq0zfaK0uE/TlHq9OLR37I/AAAAAAAAAdw/Ru_ZpXx-vVI/image_thumb%25255B26%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="596" /&gt;&lt;/a&gt;&lt;br /&gt;
Then untick the first checkbox&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/-yU3mO8f9l8w/TlHq97uJhRI/AAAAAAAAAd0/3NqfdD8PRDA/s1600-h/image%25255B45%25255D.png"&gt;&lt;img alt="image" border="0" height="464" src="http://lh4.ggpht.com/-0TLuJ23BDDs/TlHq--_nI9I/AAAAAAAAAd4/Ey3ETlfg9GY/image_thumb%25255B25%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="597" /&gt;&lt;/a&gt;&lt;br /&gt;
Finally, right click on your project, click View &amp;gt; Launch Conditions, click .NET framework and change it to .NET Framework 4 (or lower if you are in Revit 2011 mode still).&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/-jLcaF7u2msY/TlHq_7P8LwI/AAAAAAAAAd8/x91tp4w66Bo/s1600-h/image%25255B36%25255D.png"&gt;&lt;img alt="image" border="0" height="566" src="http://lh4.ggpht.com/-BqS50SUSIuU/TlHrA2XfnrI/AAAAAAAAAeA/4-oh4fPoPMQ/image_thumb%25255B20%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="593" /&gt;&lt;/a&gt;&lt;br /&gt;
Now you are done, you can right click your project and go to Build and your .msi installer will be output.&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/B4fIS58h9zs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/8186409858969838243/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=8186409858969838243" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8186409858969838243?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8186409858969838243?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/B4fIS58h9zs/revit-apihow-to-create-installer-for.html" title="[Revit API]–How to create an installer for your Revit Addins" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-nWDBnla_e2Q/TlHqznES3jI/AAAAAAAAAdI/EgnNvb1I6GQ/s72-c/image_thumb%25255B30%25255D.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/08/revit-apihow-to-create-installer-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYFQXw5eSp7ImA9WhdREUs.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-253850341488228872</id><published>2011-08-01T11:45:00.000+10:00</published><updated>2011-08-01T11:45:10.221+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-01T11:45:10.221+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><category scheme="http://www.blogger.com/atom/ns#" term="General-Dev" /><category scheme="http://www.blogger.com/atom/ns#" term=".Net" /><title>[WPF]–How to select checkbox of items in ListBox by clicking text</title><content type="html">In WPF, you can create a checked list box by creating a normal ListBox and using an ItemTemplate as follows:&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;lt;ListBox Margin=&lt;span style="color: #006080;"&gt;"10"&lt;/span&gt; HorizontalAlignment=&lt;span style="color: #006080;"&gt;"Stretch"&lt;/span&gt; Name=&lt;span style="color: #006080;"&gt;"lbSheets"&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;              VerticalAlignment=&lt;span style="color: #006080;"&gt;"Stretch"&lt;/span&gt; Width=&lt;span style="color: #006080;"&gt;"Auto"&lt;/span&gt; Grid.Row=&lt;span style="color: #006080;"&gt;"1"&lt;/span&gt; MinWidth=&lt;span style="color: #006080;"&gt;"321"&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;              MinHeight=&lt;span style="color: #006080;"&gt;"40"&lt;/span&gt; HorizontalContentAlignment=&lt;span style="color: #006080;"&gt;"Left"&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;              ItemTemplate=&lt;span style="color: #006080;"&gt;"{StaticResource ListBoxItemTemplate}"&lt;/span&gt; VerticalContentAlignment=&lt;span style="color: #006080;"&gt;"Top"&lt;/span&gt; Background=&lt;span style="color: #006080;"&gt;"#FFDCEBEE"&lt;/span&gt; SelectionMode=&lt;span style="color: #006080;"&gt;"Single"&lt;/span&gt; SelectionChanged=&lt;span style="color: #006080;"&gt;"lbSheets_SelectionChanged"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;     &amp;lt;/ListBox&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;lt;DataTemplate x:Key=&lt;span style="color: #006080;"&gt;"ListBoxItemTemplate"&lt;/span&gt; &amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;     &amp;lt;WrapPanel&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;         &amp;lt;CheckBox Focusable=&lt;span style="color: #006080;"&gt;"False"&lt;/span&gt; IsChecked=&lt;span style="color: #006080;"&gt;"{Binding Selected}"&lt;/span&gt; VerticalAlignment=&lt;span style="color: #006080;"&gt;"Center"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;         &amp;lt;ContentPresenter  Content=&lt;span style="color: #006080;"&gt;"{Binding FullName, Mode=OneTime}"&lt;/span&gt;  Margin=&lt;span style="color: #006080;"&gt;"2,0"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;     &amp;lt;/WrapPanel&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt; &amp;lt;/DataTemplate&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
In my example, I am then binding a domain model object that implements INotifyPropertyChanged, and I have a boolean property for Selected, when the checkbox is checked, it will toggle this value, and vice versa. The text that is displayed is from a property called ‘FullName’, as specified in the DataTemplate.&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/-KNXnGSFJ_xQ/TjYCzvmyeKI/AAAAAAAAAck/rfwksi1JQKE/s1600-h/image%25255B3%25255D.png"&gt;&lt;img alt="image" border="0" height="346" src="http://lh3.ggpht.com/-LQc2VL49iR4/TjYC0ihq1zI/AAAAAAAAAco/EQqtIBjjipI/image_thumb%25255B1%25255D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="346" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
However, I wanted to be able to check the checkboxes by clicking on the text next to them, not by pinpointing the check box. I tried a number of ways of doing this before finally arriving at a solution.&lt;br /&gt;
I ended up suing the ‘MouseUp’ event on the ContentPresenter from my DataTemplate &lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;lt;DataTemplate x:Key=&lt;span style="color: #006080;"&gt;"ListBoxItemTemplate"&lt;/span&gt; &amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;      &amp;lt;WrapPanel&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;          &amp;lt;CheckBox Focusable=&lt;span style="color: #006080;"&gt;"False"&lt;/span&gt; IsChecked=&lt;span style="color: #006080;"&gt;"{Binding Selected}"&lt;/span&gt; VerticalAlignment=&lt;span style="color: #006080;"&gt;"Center"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;          &amp;lt;ContentPresenter  Content=&lt;span style="color: #006080;"&gt;"{Binding FullName, Mode=OneTime}"&lt;/span&gt;  Margin=&lt;span style="color: #006080;"&gt;"2,0"&lt;/span&gt; MouseUp=&lt;span style="color: #006080;"&gt;"ContentPresenter_MouseUp"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;      &amp;lt;/WrapPanel&amp;gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;  &amp;lt;/DataTemplate&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
And in this method I did the following:&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; ContentPresenter_MouseUp(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, MouseButtonEventArgs e)&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;{&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;    &lt;span style="color: blue;"&gt;string&lt;/span&gt; text = ((TextBlock) e.OriginalSource).Text;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;    &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (var item &lt;span style="color: blue;"&gt;in&lt;/span&gt; &lt;span style="color: blue;"&gt;this&lt;/span&gt;.lbSheets.Items)&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;    {&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;        PrintableSheet sheetItem = (PrintableSheet) item;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;        &lt;span style="color: blue;"&gt;if&lt;/span&gt; (sheetItem.FullName.Equals(text))&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;        {&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;            sheetItem.Selected = !sheetItem.Selected;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;        }&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;    }&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
I used the OriginalSource proprety from the event arguments to get the TextBlock, I used its text, and matched it up with my domain object (PrintableSheet) using the property that was bound. So now when you click the text on the item, it will toggle the checkbox.&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/u7_ULLrUql0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/253850341488228872/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=253850341488228872" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/253850341488228872?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/253850341488228872?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/u7_ULLrUql0/wpfhow-to-select-checkbox-of-items-in.html" title="[WPF]–How to select checkbox of items in ListBox by clicking text" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-LQc2VL49iR4/TjYC0ihq1zI/AAAAAAAAAco/EQqtIBjjipI/s72-c/image_thumb%25255B1%25255D.png?imgmax=800" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/08/wpfhow-to-select-checkbox-of-items-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AFQHYyfCp7ImA9WhdTF0w.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-2365166302722665567</id><published>2011-07-15T18:42:00.001+10:00</published><updated>2011-07-15T18:48:31.894+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-15T18:48:31.894+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="ios" /><title>[General]– ‘Convoy’ iPhone app now live on the App Store</title><content type="html">It’s been a bit quiet around here for a while – I apologize for the lack of posts. I’ve been busy working on a number of things that have sapped all of my time. Firstly, I created the iPhone apps for the &lt;a href="http://revitconference.com.au/"&gt;Revit Technology Conference&lt;/a&gt;, these were proposed in the 11th hour, so they were fairly simple – but were well received. &lt;br /&gt;
&lt;br /&gt;
My next mobile project has been under development for a number of months now, and I’m proud to say that it is now live on the iOS app store. The project is called ‘&lt;a href="http://convoyapp.net/"&gt;Convoy&lt;/a&gt;’, and is an iPhone application designed to make driving in a ‘convoy’ a less stressful experience. Over the years I’ve come across a number of situations where myself and a group of people would be heading somewhere, be it one of Queensland’s great beaches, or a theme park, or a friends house, and someone will know the way, so everyone will try to follow them. Inevitably the group breaks up, and it becomes a stressful game of phone tag to try and organize everyone. &lt;a href="http://convoyapp.net/"&gt;Convoy&lt;/a&gt; aims to solve this. &lt;br /&gt;
&lt;br /&gt;
Check out this promo video for an in depth explanation of the problem and how it solves it:&lt;br /&gt;
&lt;div class="wlWriterEditableSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:624fc3b8-2e3a-4511-aab5-955f044c307f" style="display: inline; float: none; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;
&lt;div id="5caa3010-d365-4caa-a1ad-b89b369a9515" style="display: inline; margin: 0px; padding: 0px;"&gt;
&lt;div&gt;
&lt;a href="http://www.youtube.com/watch?v=KuTFoV8son4" target="_new"&gt;&lt;img alt="" galleryimg="no" onload="var downlevelDiv = document.getElementById('5caa3010-d365-4caa-a1ad-b89b369a9515'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;564\&amp;quot; height=\&amp;quot;317\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/KuTFoV8son4?hl=en&amp;amp;hd=1\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/KuTFoV8son4?hl=en&amp;amp;hd=1\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;564\&amp;quot; height=\&amp;quot;317\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" src="http://lh3.ggpht.com/-ERFDYyltZNQ/Th_9HTLC1KI/AAAAAAAAAUA/x2ywcgdBkXE/videoee16f20548e6%25255B32%25255D.jpg?imgmax=800" style="border-style: none;" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="clear: both; font-size: .8em; width: 564px;"&gt;
Convoy Promo Video&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Basically, the application lets you create a new Convoy on our server, which will give you a unique code to give to your friends. They enter the code into their devices and they are then presented by a map which updates ever 5 seconds with the locations of your peers. Additionally, you can then communicate with everyone in the Convoy at once using the quick communication buttons. There is a button two identify a location to pull over for a pit stop, and a button to indicate hazards. You simply tap on the map where you want to indicate, and this location is shown on everyones screens. If you need to send a more detailed message, there is a group messaging feature. &lt;br /&gt;
&lt;br /&gt;
The app is currently completely free. I’ve got plans to make a ‘lite’, advertising supported version in which you can only join Convoys but not create them, and then charge a small amount for the current, full version – so get in quick and grab it while it’s free. &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: medium;"&gt;&lt;strong&gt;You can check out the website for the app at &lt;/strong&gt;&lt;/span&gt;&lt;a href="http://convoyapp.net/"&gt;&lt;span style="font-size: medium;"&gt;&lt;strong&gt;ConvoyApp.net&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: medium;"&gt;&lt;strong&gt;, or see it &lt;/strong&gt;&lt;/span&gt;&lt;a href="http://budurl.com/convoyIOS"&gt;&lt;span style="font-size: medium;"&gt;&lt;strong&gt;live on the iTunes app store&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: medium;"&gt;&lt;strong&gt;. For fellow Android fans, I’ve got an Android version in the works, stay tuned. &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="font-size: medium;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
For those interested in the technical details, I’ll make a post soon outlining the various libraries and web services that I used for this app and my experiences with them. But briefly, the back end uses NodeJS (hosted on Heroku), MongoDB (hosted on MongoHQ) and Amazon S3 (for icon storage). I’ve used a bunch of great open source Objective C libraries as well which I look forward to writing about.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Let me know what you think, if you have an suggestions I’d love to hear them, my email address is listed &lt;a href="http://rodhowarth.com/"&gt;HERE&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
PS, I would have loved to have licensed the &lt;a href="http://www.youtube.com/watch?v=xdc0Oq1VwH4"&gt;Convoy song&lt;/a&gt; for the video, but it wasn’t to be :)&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/oLwooy9oFUs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/2365166302722665567/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=2365166302722665567" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2365166302722665567?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2365166302722665567?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/oLwooy9oFUs/general-convoy-iphone-app-now-live-on.html" title="[General]– ‘Convoy’ iPhone app now live on the App Store" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-ERFDYyltZNQ/Th_9HTLC1KI/AAAAAAAAAUA/x2ywcgdBkXE/s72-c/videoee16f20548e6%25255B32%25255D.jpg?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/07/general-convoy-iphone-app-now-live-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YCRnk7fCp7ImA9WhZWFUQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-2026469355260143399</id><published>2011-05-17T07:35:00.000+10:00</published><updated>2011-05-17T11:19:27.704+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-17T11:19:27.704+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit API]–API Wishlists</title><content type="html">&lt;p&gt;The yearly Autodesk API wish list surveys are available online now, I encourage you to fill them out to help shape future releases of the API.&lt;/p&gt;  &lt;p&gt;AutoCAD   &lt;br /&gt;&lt;a href="http://www.zoomerang.com/Survey/WEB22C9QA2TDYR"&gt;http://www.zoomerang.com/Survey/WEB22C9QA2TDYR&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Autodesk Inventor   &lt;br /&gt;&lt;a href="http://www.zoomerang.com/Survey/WEB22C9QBPTEZ5"&gt;http://www.zoomerang.com/Survey/WEB22C9QBPTEZ5&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Autodesk Revit     &lt;br /&gt;&lt;/strong&gt;&lt;a href="http://www.zoomerang.com/Survey/WEB22C9QACTE6V"&gt;&lt;strong&gt;http://www.zoomerang.com/Survey/WEB22C9QACTE6V&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;AutoCAD Civil 3D   &lt;br /&gt;&lt;a href="http://www.zoomerang.com/Survey/WEB22C9Q8JTD3G"&gt;http://www.zoomerang.com/Survey/WEB22C9Q8JTD3G&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Autodesk Navisworks   &lt;br /&gt;&lt;a href="http://www.zoomerang.com/Survey/WEB22C9QBRTF2C"&gt;http://www.zoomerang.com/Survey/WEB22C9QBRTF2C&lt;/a&gt;&lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/vTGUVtXJlls" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/2026469355260143399/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=2026469355260143399" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2026469355260143399?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/2026469355260143399?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/vTGUVtXJlls/revit-apiapi-wishlists.html" title="[Revit API]–API Wishlists" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/05/revit-apiapi-wishlists.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYGSHw4eyp7ImA9WhZXF0o.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-7160403525007269610</id><published>2011-05-08T00:05:00.001+10:00</published><updated>2011-05-08T00:05:29.233+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-08T00:05:29.233+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit] Running a local Revit Server on Windows 7 safely–free utility</title><content type="html">&lt;p&gt;Autodesk Revit Server is a product that comes bundled with Revit 2011 and 2012. It provides a way for you to better coordinate Revit access over a wide area network by hosting your central model in Revit Server and connecting your Revit to that instead of opening a .rvt file on a network drive. This is particularly useful for companies with multiple offices, as Revit Server allows you to setup a ‘central’ server and ‘local’ servers are different locations. Saves to the Local servers are done over a LAN, and the local server then synchronizes the model back to the central server in an optimized fashion. Thus providing an alternative to expensive WAN optimization devices such as those provided by Riverbed. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;One usage instance that many people are interested in, is having a local Revit server instance installed on their laptop for when they work remotely. That way saves to central over a VPN are done quickly, and Revit Server will synchronize the model back to the office in the background. The problem is, Revit Server only supports Windows Server 2008 R2, which is very expensive. However there is a way around this, you can, unofficially install Revit Server on your Windows 7 computer. I’ve had success in getting this setup, and &lt;a href="http://do-u-revit.blogspot.com/2011/04/revit-server-goes-desktop.html"&gt;so has Dave Baldacchino&lt;/a&gt; from the blog &lt;a href="http://do-u-revit.blogspot.com/"&gt;Do U Revit&lt;/a&gt;. Check out &lt;a href="http://do-u-revit.blogspot.com/2011/04/revit-server-goes-desktop.html"&gt;his post&lt;/a&gt; on the topic and read the ‘setup’ section for instructions on how you can get it running. There is some danger in this approach, as Robert from the blog &lt;a href="http://dorevit.blogspot.com/2011/05/taking-revit-server-off-road.html"&gt;‘Don’t think: Do Revit’&lt;/a&gt; warns, that shutting the server down while it is still trying to synchronize back to the central server &lt;a href="http://dorevit.blogspot.com/2011/05/taking-revit-server-off-road.html"&gt;can cause some issues.&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is a problem, as Revit Server has no inbuilt way to tell when it is synchronizing. To solve this issue, I’ve created a small utility that sits in your system tray, and tells you when Revit Server is communicating with anyone. I call it ‘Revit Server Monitor’&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TcVRmLLgYTI/AAAAAAAAAOY/PzajWU-l__Y/s1600-h/image%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TcVRnI4qDWI/AAAAAAAAAOc/06B3VQd73Wk/image_thumb%5B1%5D.png?imgmax=800" width="485" height="194" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You run the program, and minimize it to your computers tray. You will then see a green arrow to indicate that the Revit Server is not currently communicating with anyone.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TcVRn79aG-I/AAAAAAAAAOg/18pWr3SjOac/s1600-h/image%5B6%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TcVRomEMfhI/AAAAAAAAAOk/cn0RggPEQ-Q/image_thumb%5B2%5D.png?imgmax=800" width="243" height="39" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Or if any sort of communication is in progress, you will see a red arrow. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TcVRpOPhULI/AAAAAAAAAOo/VaaTOZ1JfUc/s1600-h/image%5B9%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TcVRp8TZCSI/AAAAAAAAAOs/TLB1tzIKB3M/image_thumb%5B3%5D.png?imgmax=800" width="244" height="43" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So if there is a red arrow, don’t shut your computer down. Wait for a green arrow to be safe. &lt;/p&gt;  &lt;p&gt;This works by reading port 808, which is the primary port that Revit Server uses to communicate. Using the WinPCap utility, my code can monitor traffic on this port, if it detects any, it will show the red signal. If there has been no traffic on that port for 5 seconds, the signal will turn green. You can download the tool from &lt;a href="http://rodhowarth.com/Downloads/Software/RevitServerMonitorv0.2.zip"&gt;here&lt;/a&gt;. To set it up, you must first install WinPCap, which is included in the zip, and then just run the RevitServerMonitor exe (perhaps add it to your computers startup folder as well so you don’t forget to run it). The program itself requires .NET 3.5 to run, but if you have Revit installed you will have that installed as well. If you are a little worried about having software that monitors packets running on your PC, feel free to &lt;a href="https://github.com/RodH257/RevitServerMonitor"&gt;browse the source code here&lt;/a&gt;, it’s fairly simple!&lt;/p&gt;  &lt;p&gt;If you are running a Revit Server on your Windows PC, do try it and let me know how it goes, I’m not guaranteeing it will prevent model corruption but I’d love to hear your feedback on how well it worked.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rodhowarth.com/Downloads/Software/RevitServerMonitorv0.2.zip"&gt;Download the software here.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://github.com/RodH257/RevitServerMonitor"&gt;View the source code here.&lt;/a&gt;&lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/6kykRTM3TDg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/7160403525007269610/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=7160403525007269610" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/7160403525007269610?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/7160403525007269610?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/6kykRTM3TDg/revit-running-local-revit-server-on.html" title="[Revit] Running a local Revit Server on Windows 7 safely–free utility" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_PZEkMtbO9tU/TcVRnI4qDWI/AAAAAAAAAOc/06B3VQd73Wk/s72-c/image_thumb%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/05/revit-running-local-revit-server-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcHQXo4eSp7ImA9WhZXFE0.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-1385556073690149483</id><published>2011-05-03T17:00:00.001+10:00</published><updated>2011-05-03T17:00:30.431+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-03T17:00:30.431+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><title>[Revit API] How to allow add-ins to be loaded off a network drive, in code</title><content type="html">&lt;p&gt;I previously posted about how in Revit 2012, you can no longer store your add-ins on a network drive, unless you edit the revit.exe.config. This is a bit of a pain if you have to go to each users machine and edit this file individually, especially given that if you make a typo, your Revit won’t open.&lt;/p&gt;  &lt;p&gt;Here’s how to do this edit in C# code, so if you make an installation utility to run on your users computers, you can add this bit of code in to do the changes for you.&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Configuration revitExeConfig = ConfigurationManager.OpenExeConfiguration(&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #006080"&gt;@&amp;quot;C:\Program Files\Autodesk\Revit Structure 2012\Program\Revit.exe&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;ConfigurationSection section = revitExeConfig.GetSection(&lt;span style="color: #006080"&gt;&amp;quot;runtime&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;string&lt;/span&gt; xml = section.SectionInformation.GetRawXml();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;if&lt;/span&gt; (!xml.Contains(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;loadFromRemoteSources enabled=\&amp;quot;true\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    xml = xml.Replace(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;runtime&amp;gt;&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;runtime&amp;gt; \r\n &amp;lt;loadFromRemoteSources enabled=\&amp;quot;true\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    section.SectionInformation.SetRawXml(xml);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    revitExeConfig.Save();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Of course, I’ve hard coded in Revit Structure 2012 here as Revit installation to edit. You could change this to the installation that suits yours, or alternatively you could use the RevitAddinUtility.dll that ships with Revit. If you add a reference to that to your project you can then get the install location of all Revit products using:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;foreach&lt;/span&gt; (RevitProduct product &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; RevitProductUtility.GetAllInstalledRevitProducts())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;//no point editing the Revit 2011 exe config files&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;if&lt;/span&gt; (product.Version == RevitVersion.Revit2012)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;string&lt;/span&gt; productLocation = product.InstallLocation + &lt;span style="color: #006080"&gt;&amp;quot;program\\revit.exe&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;If you put that all together with the above code you can do something like:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; EditExeConfigs()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;foreach&lt;/span&gt; (RevitProduct product &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; RevitProductUtility.GetAllInstalledRevitProducts())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;//no point editing the Revit 2011 exe config files&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;if&lt;/span&gt; (product.Version == RevitVersion.Revit2012)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;string&lt;/span&gt; productLocation = product.InstallLocation + &lt;span style="color: #006080"&gt;&amp;quot;program\\revit.exe&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            Configuration revitExeConfig = ConfigurationManager.OpenExeConfiguration(productLocation);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            ConfigurationSection section = revitExeConfig.GetSection(&lt;span style="color: #006080"&gt;&amp;quot;runtime&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;string&lt;/span&gt; xml = section.SectionInformation.GetRawXml();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;if&lt;/span&gt; (!xml.Contains(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;loadFromRemoteSources enabled=\&amp;quot;true\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                xml = xml.Replace(&lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;runtime&amp;gt;&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;&amp;lt;runtime&amp;gt; \r\n &amp;lt;loadFromRemoteSources enabled=\&amp;quot;true\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                section.SectionInformation.SetRawXml(xml);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                revitExeConfig.Save();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Which will edit the exe.config file for all 3 Revit products if they are installed, or do nothing if they aren’t. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/d9Miaxv6Qqk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/1385556073690149483/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=1385556073690149483" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/1385556073690149483?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/1385556073690149483?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/d9Miaxv6Qqk/revit-api-how-to-allow-add-ins-to-be.html" title="[Revit API] How to allow add-ins to be loaded off a network drive, in code" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/05/revit-api-how-to-allow-add-ins-to-be.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AGQXk_fip7ImA9WhZQGEQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-3793902570793034578</id><published>2011-04-27T18:08:00.000+10:00</published><updated>2011-04-27T18:08:40.746+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-27T18:08:40.746+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="General-Dev" /><title>[General Dev]–Using Git with an SVN server</title><content type="html">&lt;a href="http://git-scm.com/" target="_blank"&gt;Git&lt;/a&gt; is a great version control system, one which has &lt;a href="http://whygitisbetterthanx.com/" target="_blank"&gt;many benefits over Subversion&lt;/a&gt;. However, many companies may already have existing Subversion setups that they are reluctant to move away from. In our office we use &lt;a href="http://www.visualsvn.com/server/" target="_blank"&gt;VisualSVN&lt;/a&gt; server and the &lt;a href="http://www.jetbrains.com/teamcity/" target="_blank"&gt;TeamCity&lt;/a&gt; continuous integration server, and while we could migrate fully to Git, I don’t want to make the jump just yet, as I’m the only Git convert here – for now. &lt;br /&gt;
Enter &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html" target="_blank"&gt;Git SVN&lt;/a&gt;. Git SVN allows you to use a local git repository with a remote subversion server. This means that you can initialize git and commit like crazy, and then when you are ready to share your changes with the rest of your team, you synchronize them with the Subversion server. &lt;br /&gt;
This is not without its pitfalls – they are two very different version control systems, so if you are doing complex things with them, you may run into some troubles. However where I work we have small teams, and many of my projects are done solely by me, so Git SVN works out great for us, as the main reason for pushing the code to the Subversion server is so that it’s backed up and easily retrieved in the future. &lt;br /&gt;
I’ve run into a few issues at times with setting this up, so I thought that I’d create a quick guide for how I am now doing it on new projects. &lt;br /&gt;
First of all, I create my subversion repository in VisualSVN. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TZqYgkDVyQI/AAAAAAAAALQ/CZwrYlex2wA/s1600-h/image%5B6%5D.png"&gt;&lt;img alt="image" border="0" height="212" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TZqYhQbCYAI/AAAAAAAAALU/auOjRLKjCIM/image_thumb%5B2%5D.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="382" /&gt;&lt;/a&gt;&lt;br /&gt;
I like to setup the standard SVN directory structure, and Git SVN can accommodate this. &lt;br /&gt;
I then open a git bash at the parent folder of where my project will go (or where it currently is – this still works if you’ve already created your solution/folders, as long as they are named the same, or you move the files).&lt;br /&gt;
run the command ‘git svn clone –s URL’ where URL is the path to your subversion server. I’ve found that this must be in all lowercase. The –s tag specifies that you are using the standard SVN directory structure – emit this if you didn’t create it when you setup your repository. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TZqYiQASuMI/AAAAAAAAALY/0qZGdXlsEaM/s1600-h/image%5B10%5D.png"&gt;&lt;img alt="image" border="0" height="310" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TZqYjWazz7I/AAAAAAAAALc/EmCKfkWl-ME/image_thumb%5B4%5D.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="518" /&gt;&lt;/a&gt;&lt;br /&gt;
This command will then check out your subversion repository into a directory of the same name as the repository – it will either create this, or use an existing one if it has the same name. &lt;br /&gt;
Next, make sure your .gitignore file is setup in the directory and then cd into it with ‘cd REPOSITORY_NAME’. Git status will show you the current files ready to be checked in.&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TZqYkXH0yrI/AAAAAAAAALg/XFAelAubj_4/s1600-h/image%5B14%5D.png"&gt;&lt;img alt="image" border="0" height="238" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TZqYlMxMPFI/AAAAAAAAALk/3eTV4Mek_Ag/image_thumb%5B6%5D.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="397" /&gt;&lt;/a&gt;&lt;br /&gt;
Then you should be able to do your first git commit &lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TZqYl38aTbI/AAAAAAAAALo/jtS6E1Lla5s/s1600-h/image%5B18%5D.png"&gt;&lt;img alt="image" border="0" height="173" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TZqYmvkPYJI/AAAAAAAAALs/1pB4B_gcZ-s/image_thumb%5B8%5D.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="464" /&gt;&lt;/a&gt;&lt;br /&gt;
Now your local git repository is up to date – so you are doing version control, and you can go along like this checking in regularly, then when it’s time to send the commits to the server, use ‘git svn dcommit’ &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TZqYnR3C5II/AAAAAAAAALw/nzejUBMBqx4/s1600-h/image%5B22%5D.png"&gt;&lt;img alt="image" border="0" height="337" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TZqYoMPQpBI/AAAAAAAAAL0/MV8PFqgpG4I/image_thumb%5B10%5D.png?imgmax=800" style="background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="466" /&gt;&lt;/a&gt;&lt;br /&gt;
Then you are all up to date! You can also use ‘git svn fetch’ to to a svn update from the server if others on your team have committed.&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/rlW86HhAGHI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/3793902570793034578/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=3793902570793034578" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/3793902570793034578?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/3793902570793034578?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/rlW86HhAGHI/general-devusing-git-with-svn-server.html" title="[General Dev]–Using Git with an SVN server" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_PZEkMtbO9tU/TZqYhQbCYAI/AAAAAAAAALU/auOjRLKjCIM/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/04/general-devusing-git-with-svn-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkAEQ3w5eCp7ImA9WhZQEko.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-8392846812590986343</id><published>2011-04-20T13:18:00.002+10:00</published><updated>2011-04-20T13:38:22.220+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-20T13:38:22.220+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit API]– Running your add-ins from a network drive in Revit 2012</title><content type="html">In previous years our office has run our add-ins directly off a network drive. I’ve placed the DLL files in a network directory, and then installed the .addin manifest file on each users computer that points to these DLL’s. This way when I update the add-ins I only need to update one location and the users simply need to reboot Revit.&lt;br /&gt;
&lt;br /&gt;
To get this to work, I just had to run caspol.exe on each machine to make their machines trust that certain location, for example:&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;echo y|C:\WINDOWS\Microsoft.NET\Framework\v3.5\caspol.exe -cg LocalIntranet_Zone FullTrust &lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;echo y|C:\WINDOWS\Microsoft.NET\Framework\v3.5\caspol.exe -m -ag 1.2 -url file://L:\* FullTrust&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
However in upgrading the add-ins to Revit 2012, this method did not work. The add-ins simply would not load, and in the journal file I was seeing this error:&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;Jrn.RibbonEvent &lt;span style="color: #006080;"&gt;"Execute external command:35015:Plotting.PLT"&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span style="color: #006080;"&gt;' 0:&amp;lt; DBG_WARN: Could not load file or assembly '&lt;/span&gt;file:///L:\Plotting.dll' or one of its dependencies. Operation &lt;span style="color: blue;"&gt;is&lt;/span&gt; not supported. (Exception from HRESULT: 0x80131515): line 171 of AddIn\AddInItem.cpp. &lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
This was when my assemblies were compiled in .NET 4 and the same error occurred after I recompiled them in .NET 3.5. I had a feeling that it might have something to do with the changes in security that were introduced with .NET 4, but the fact that it happened to .NET 3.5 dll’s as well was odd. &lt;br /&gt;
Turns out there’s a fix for it, which is a little bit of a pain, your user needs to update their revit.exe.config file in the Revit program directory (C:\Program Files\Autodesk\Revit Structure 2012\Program) and make the following change:&lt;br /&gt;
&lt;br /&gt;
look for the &amp;lt;runtime&amp;gt; tag, and just after it’s opening, put:&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;loadFromRemoteSources&lt;/span&gt; &lt;span style="color: red;"&gt;enabled&lt;/span&gt;&lt;span style="color: blue;"&gt;="true"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
making it:&lt;br /&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;runtime&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;  &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;loadFromRemoteSources&lt;/span&gt; &lt;span style="color: red;"&gt;enabled&lt;/span&gt;&lt;span style="color: blue;"&gt;="true"&lt;/span&gt; &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="background-color: white; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;  &lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;generatePublisherEvidence&lt;/span&gt; &lt;span style="color: red;"&gt;enabled&lt;/span&gt;&lt;span style="color: blue;"&gt;="false"&lt;/span&gt;&lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: 'Courier New', courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;runtime&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
The add-ins should then run correctly. This is however a bit of a pain, I’ll have to incorporate this into an installation tool. I’d love to hear of a better solution to this problem if anyone knows of one, however for now, this will work around it. &lt;br /&gt;
&lt;br /&gt;
Thanks to &lt;a href="http://aaronwball.com/2010/08/22/visual-studio-2010-debugging-in-remote-locations/"&gt;this post&lt;/a&gt; for helping to point me in the right direction.&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/lcjeC5Uy40Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/8392846812590986343/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=8392846812590986343" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8392846812590986343?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8392846812590986343?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/lcjeC5Uy40Y/revit-api-running-your-add-ins-from.html" title="[Revit API]– Running your add-ins from a network drive in Revit 2012" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/04/revit-api-running-your-add-ins-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIEQHk7cCp7ImA9WhZQEUQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-4653432121645268254</id><published>2011-04-19T17:35:00.001+10:00</published><updated>2011-04-19T17:35:01.708+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-19T17:35:01.708+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit]–Where have the journal files gone in Revit 2012?</title><content type="html">&lt;p&gt;If you’ve made the jump to Revit 2012, you may have noticed that there is a new directory structure in the program files dir. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/Ta07IWJF8gI/AAAAAAAAAOQ/HLAiBafHjGg/s1600-h/image%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/Ta07JHAwuoI/AAAAAAAAAOU/A529MirC68k/image_thumb%5B1%5D.png?imgmax=800" width="476" height="161" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There is no longer a journals folder. So where has it gone? The answer is that It appears to have been moved to the AppData directory.&lt;/p&gt;  &lt;p&gt;C:\Users\USERNAME\AppData\Local\Autodesk\Revit\Autodesk Revit Structure 2012\Journals&lt;/p&gt;  &lt;p&gt;Replace the uername with your username, and also enter the correct Revit vertical you are using. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/yqL7koVGOBs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/4653432121645268254/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=4653432121645268254" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/4653432121645268254?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/4653432121645268254?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/yqL7koVGOBs/revitwhere-have-journal-files-gone-in.html" title="[Revit]–Where have the journal files gone in Revit 2012?" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_PZEkMtbO9tU/Ta07JHAwuoI/AAAAAAAAAOU/A529MirC68k/s72-c/image_thumb%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/04/revitwhere-have-journal-files-gone-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUABRX0zeyp7ImA9WhZQEUQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-5519733598802680295</id><published>2011-04-19T07:15:00.000+10:00</published><updated>2011-04-19T16:15:54.383+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-19T16:15:54.383+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="General-Dev" /><title>[General-Dev]– Mapping integer Enums in Fluent NHibernate</title><content type="html">&lt;p&gt;For those of you that don’t know, Fluent NHibernate is a great project for anyone that uses NHibernate in their .NET development. Instead of creating Hibernate XML files for your mappings (yuck), you can use a strongly typed, 'fluent’ syntax in C# code.&amp;#160; An example mapping for a class would look something like:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; Table(&lt;span style="color: #006080"&gt;&amp;quot;Staff&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; Id(x =&amp;gt; x.Id).Column(&lt;span style="color: #006080"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;).GeneratedBy.Native();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; Map(x =&amp;gt; x.LastSaved);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; Map(x =&amp;gt; x.FirstName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; Map(x =&amp;gt; x.LastName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; References(x =&amp;gt; x.SalaryInfo, &lt;span style="color: #006080"&gt;&amp;quot;SalaryInfoId&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;I recently converted some mapping files of my own over from hibernate XML to Fluent NHibernate and came across one gotcha worth mentioning. In my project, I had some Enums as properties. Say for example EmploySection enum might have EmploySection.Administration, EmploySection.Structural, EmploySection.Civil as options. My database had these mapped as integers previously, and NHibernate would take this mapping and cast the enum as an integer and save it to the database. &lt;/p&gt;

&lt;p&gt;By default, Fluent NHIbernate does this differently, it uses a string to save the enum value to the database. This caused some issues as I had existing data which needed to read these fields, so I wanted to tell NHibernate how to do this. &lt;/p&gt;

&lt;p&gt;The solution is to add ‘.CustomType(typeof(int))’ to the end of your mapping, for example:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; Map(x =&amp;gt; x.EmploySection).CustomType(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
This fixed the problem for me. Also something to note, is that if you get exceptions in your mappings, take a look deeper into the exception as often a cryptic error may hide a more detailed NHibernate error underneath. 




  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/14sYKA1tV98" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/5519733598802680295/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=5519733598802680295" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/5519733598802680295?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/5519733598802680295?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/14sYKA1tV98/general-dev-mapping-integer-enums-in.html" title="[General-Dev]– Mapping integer Enums in Fluent NHibernate" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/04/general-dev-mapping-integer-enums-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQBR385eip7ImA9WhZQEUQ.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-670147339303779594</id><published>2011-04-17T19:38:00.003+10:00</published><updated>2011-04-19T15:19:16.122+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-19T15:19:16.122+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="General-Dev" /><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title>[General-Dev]–Introduction to Git on Windows via GitExtensions</title><content type="html">For those of you that haven’t heard of it, Git is a version control system created by Linus Torvalds (creator of Linux). Since it’s inception, it has gained a huge following, primarily in the open source community, especially for developers on UNIX based operating systems such as Linux, and OSX. However recently it has been gaining a foothold with Windows based developers as well, due to it’s &lt;a href="http://whygitisbetterthanx.com/"&gt;advantages over other source control software&lt;/a&gt;. By origin, Git was designed to be a command line tool, which is efficient and great for automation, but can be a barrier for newcomers. However there are some projects that are providing a graphical interface to this, which I’ll talk about in this post.&lt;br /&gt;
&lt;br /&gt;
If you are new to version control, basically it involves you ‘checking in’ your&amp;nbsp; code at various points of development. This keeps a version history of your project, so if you delete some code, and then later on decide you want it back, you can easily rollback changes, or check out an old version. Additionally, you can setup a version control server, which you check your code into, which effectively then serves as a backup for your code in case your main development computer dies. &lt;a href="http://subversion.apache.org/"&gt;Subversion&lt;/a&gt; is a great example of a popular version control system with great support in Windows. &lt;a href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN&lt;/a&gt;, &lt;a href="http://ankhsvn.open.collab.net/"&gt;AnkhSVN&lt;/a&gt; and &lt;a href="http://www.visualsvn.com/server/"&gt;Visual SVN Server&lt;/a&gt; are a great, free way to get setup with Subversion on Windows and Visual Studio if you decide that Git isn’t for you. &lt;br /&gt;
&lt;br /&gt;
If you are already familiar with Subversion, you should be aware that Git works a little differently. First of all, Git keeps a full copy of the repository on your local computer, so you can continue checking in frequently even when you cannot access the remote server. The workflow in Git involves you committing regularly to your local Git repository, and then when you are ready to share your changes with the rest of your team you ‘push’ them to a remote server. This allows Git users to commit far more frequently than Subversion users as they don’t have to worry about sending half finished changes to the rest of the team. Additionally, you can have multiple ‘remotes’ that you push your code to, allowing a ‘distributed’ architecture. Git also does things differently to Subversion when it comes to branching. While branching was nothing short of a nightmare in Subversion, Git has a great branching system that allows you to merge changes together with less conflicts for you to manually sort out.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
For more information on using Git, check out the &lt;a href="http://git-scm.com/documentation"&gt;Git website’s documentation section&lt;/a&gt;. I personally read the book ‘&lt;a href="http://www.amazon.com/gp/product/1430218339/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=rodhow-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1430218339"&gt;Pro Git&lt;/a&gt;’ on my &lt;a href="http://www.amazon.com/gp/product/B002Y27P3M/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=rodhow-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B002Y27P3M"&gt;Kindle&lt;/a&gt; when learning the system, and found it probably goes into more depth than you need in day to day use, but if you want to get a good understanding of how it all works, it’s a good place to start. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;So, how do I get started using this on Windows? &lt;/strong&gt;&lt;br /&gt;
There are two ways to get started. First of all, if you are a command line fiend, you can simply head over to the Git Website and download the Windows installer, this&amp;nbsp;will give you access to the ‘git bash’ that lets you use all the git commands to manage your code.&lt;br /&gt;
&lt;br /&gt;
Alternatively, if you prefer the option of a graphical user interface (as well as a fallback to the command line) you should check out &lt;a href="http://code.google.com/p/gitextensions/"&gt;Git Extensions&lt;/a&gt;. Git extensions is a great project that provides Windows Explorer and Visual Studio integration for Git. It’s not perfect, but it’s probably the best GUI for Git on Windows at the moment (there is a &lt;a href="http://code.google.com/p/tortoisegit/"&gt;TortoiseGIT&lt;/a&gt; project as well if that’s your preference). &lt;br /&gt;
&lt;br /&gt;
Download the installer, and run through it. I choose to install MsysGit and KDiff, but otherwise just leave everything as the defaults.&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0opuZG1I/AAAAAAAAAMo/se2mDVC8ycw/image%5B3%5D.png?imgmax=800"&gt;&lt;img alt="image" border="0" height="218" src="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0uybE59I/AAAAAAAAAMs/3N10quRHPmQ/image_thumb%5B1%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="277" /&gt;&lt;/a&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/Taq0vWbodTI/AAAAAAAAAMw/4RWP2gEjAHM/s1600-h/image%5B7%5D.png"&gt;&lt;img alt="image" border="0" height="217" src="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0wZRKIyI/AAAAAAAAAM0/ofmM9NSVsjw/image_thumb%5B3%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="276" /&gt;&lt;/a&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0w46A-hI/AAAAAAAAAM4/d8q9bA0hIHw/s1600-h/image%5B12%5D.png"&gt;&lt;img alt="image" border="0" height="216" src="http://lh3.ggpht.com/_PZEkMtbO9tU/Taq0xUbzJXI/AAAAAAAAAM8/LMau5mveMns/image_thumb%5B6%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="274" /&gt;&lt;/a&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0yEX_Y0I/AAAAAAAAANA/bYvSf0I4--w/s1600-h/image%5B19%5D.png"&gt;&lt;img alt="image" border="0" height="216" src="http://lh3.ggpht.com/_PZEkMtbO9tU/Taq0y5NZcLI/AAAAAAAAANE/lRXslKcFkCg/image_thumb%5B9%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="276" /&gt;&lt;/a&gt;&lt;br /&gt;
when the Git setup wizard comes up, it’s a good idea to tick the option for ‘Git bash here’ windows explorer integration. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0z_Z4ksI/AAAAAAAAANI/3OMqvToJAj4/s1600-h/image%5B28%5D.png"&gt;&lt;img alt="image" border="0" height="218" src="http://lh5.ggpht.com/_PZEkMtbO9tU/Taq00ZuRd-I/AAAAAAAAANM/eDqalgkLSqQ/image_thumb%5B13%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="280" /&gt;&lt;/a&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/Taq01LDdcVI/AAAAAAAAANQ/KLW99D77yvE/s1600-h/image%5B27%5D.png"&gt;&lt;img alt="image" border="0" height="218" src="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq01w-UPcI/AAAAAAAAANU/9NWRAihqiaU/image_thumb%5B12%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="280" /&gt;&lt;/a&gt;&lt;br /&gt;
Once this is done, you’ll notice you can then right click on folders and see the various Git Extensions shortcuts&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/Taq02fCXXBI/AAAAAAAAANY/c4mE_OKiCGw/s1600-h/image%5B32%5D.png"&gt;&lt;img alt="image" border="0" height="341" src="http://lh5.ggpht.com/_PZEkMtbO9tU/Taq03NFKHLI/AAAAAAAAANc/FknvPBUXSu0/image_thumb%5B15%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="412" /&gt;&lt;/a&gt;&lt;br /&gt;
or alternatively you can click the ‘Git Bash Here’ option and see the command line. &lt;br /&gt;
But first, you’ll have to head into the ‘Settings’ section of Git Extensions and setup a username and email address&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/Taq031VDRnI/AAAAAAAAANg/qTVH_h98uhg/s1600-h/image%5B36%5D.png"&gt;&lt;img alt="image" border="0" height="268" src="http://lh4.ggpht.com/_PZEkMtbO9tU/Taq04WFUvoI/AAAAAAAAANk/x-MRXPo3mQg/image_thumb%5B17%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="429" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Then you are all configured, if you open visual studio and create or open a project, you should see a ‘Git’ dropdown menu at the top of the screen. From here you can initialize a new repository&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/Taq047Jh1RI/AAAAAAAAANo/H707Vf9Q09M/s1600-h/image%5B40%5D.png"&gt;&lt;img alt="image" border="0" height="399" src="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq06NP_xnI/AAAAAAAAANs/1of_HjmolIA/image_thumb%5B19%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="264" /&gt;&lt;/a&gt;&lt;br /&gt;
After this you are ready to do your first commit, you can do that from the ‘Commit’ option. You’ll then see the commit screen:&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/Taq065nDJvI/AAAAAAAAANw/KO9S7kUH2mw/s1600-h/image%5B45%5D.png"&gt;&lt;img alt="image" border="0" height="330" src="http://lh3.ggpht.com/_PZEkMtbO9tU/Taq075tdC0I/AAAAAAAAAN0/GkX5ao2DS2g/image_thumb%5B22%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="452" /&gt;&lt;/a&gt;&lt;br /&gt;
You may notice a large amount of junk/temp files that you don’t want to commit into your version control, you can remove these by creating a .gitignore file in your project directory. GitExtensions has a preconfigured file of these you can use. Go to working dir changes, edit ignored files and click ‘add default ignores’ &lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/Taq08gm0uuI/AAAAAAAAAN4/jvJu31RCSoU/s1600-h/image%5B49%5D.png"&gt;&lt;img alt="image" border="0" height="354" src="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq09o-hEEI/AAAAAAAAAN8/5jkGY-U6RTE/image_thumb%5B24%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="449" /&gt;&lt;/a&gt;&lt;br /&gt;
You should then see your files list shrink somewhat. You can now ‘stage’ your files (which is a git terminology, it lets you choose which files you are going to commit at any point, though many people simply stage and commit all at once) , enter a commit message and then commit them.&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/Taq0-e1AVBI/AAAAAAAAAOA/on1B7XGyH7I/s1600-h/image%5B53%5D.png"&gt;&lt;img alt="image" border="0" height="331" src="http://lh4.ggpht.com/_PZEkMtbO9tU/Taq0_TJw_WI/AAAAAAAAAOE/LhiMp7DB8Ok/image_thumb%5B26%5D.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="453" /&gt;&lt;/a&gt;&lt;br /&gt;
Then you will have just made your first revision! These revisions are internally stored in the .git folder in your projects base, so you could copy and paste your project folder around, store it in &lt;a href="http://db.tt/3pQ41cL"&gt;Dropbox&lt;/a&gt;, zip it up and email it – all while keeping this all in tact.&lt;br /&gt;
As you can see, Git Extensions is quite useful for the general Git workflow, and is a good way to get introduced to the Git world. I personally prefer the command line most of the time, but having Git in my Visual Studio is very handy. For more information on how to use Git Extensions, check out &lt;a href="http://gitextensions.googlecode.com/files/Git%20Extensions%20-%20User%20Manual.pdf"&gt;this manual&lt;/a&gt;. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq1AClD1-I/AAAAAAAAAOI/IEEmrdBaC4E/s1600-h/github%5B2%5D.png"&gt;&lt;img alt="github" border="0" height="64" src="http://lh3.ggpht.com/_PZEkMtbO9tU/Taq1AmO-N8I/AAAAAAAAAOM/4vGf1QClxP4/github_thumb.png?imgmax=800" style="background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="github" width="124" /&gt;&lt;/a&gt;&lt;br /&gt;
Finally, now that you know how to get Git running as a local repository, I recommend you take a look at arguably the best feature of Git – &lt;a href="http://db.tt/3pQ41cL"&gt;Github.com&lt;/a&gt;. Github.com is an online repository hosting service that has gained huge popularity, and today drives people to take a look at Git, even if it is just to make use of their services. If you are happy for your project to be open source, Github gives you free hosting, if not, you can pay a small fee a month to get some repositories. Their servers are rock solid, and their web interface is wonderful. You should definately check it out. &lt;br /&gt;
Much of the code that I create for this blog is available &lt;a href="https://github.com/RodH257"&gt;on my Github profile&lt;/a&gt;. &lt;br /&gt;
I hope that this article has given you enough of an introduction to Git to encourage you to do some more reading on it. If you aren’t using any version control for all of your projects, no matter how small, please, start doing so – you’ll thank yourself later!&lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/aLG32PzacXo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/670147339303779594/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=670147339303779594" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/670147339303779594?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/670147339303779594?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/aLG32PzacXo/general-devintroduction-to-git-on.html" title="[General-Dev]–Introduction to Git on Windows via GitExtensions" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_PZEkMtbO9tU/Taq0uybE59I/AAAAAAAAAMs/3N10quRHPmQ/s72-c/image_thumb%5B1%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/04/general-devintroduction-to-git-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcESHk_cCp7ImA9WhZSE0s.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-6508347013120928428</id><published>2011-03-29T12:45:00.000+10:00</published><updated>2011-03-29T12:50:09.748+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-29T12:50:09.748+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><title>[Revit API]–Revit 2012 and Vendor IDs</title><content type="html">&lt;p&gt;The NDA has lifted on Revit 2012, and Jeremy Tammik has posted &lt;a href="http://thebuildingcoder.typepad.com/blog/2011/03/revit-2012-api-features.html" target="_blank"&gt;a summary of the Revit API changes and additions&lt;/a&gt;. I hope to add some Revit 2012 information as I get stuck into it over the coming weeks, however for now I wanted to throw up a post to tell you about the new Vendor ID’s.&lt;/p&gt;  &lt;p&gt;In Revit 2012, each add-in that you make must be associated with a ‘Vendor ID’, which is an &lt;a href="http://www.autodesk.com/symbreg/" target="_blank"&gt;Autodesk Registered Developer Symbol&lt;/a&gt;. In the .addin manifest file you must enter this vendor ID as another field. This helps to identify who made the application, and also is used for some great new features like the ‘Extensible Storage’, which lets you put some private API data in the model that only addins with your Vendor ID can use. &lt;/p&gt;  &lt;p&gt;While you may not have started developing Revit 2012 addins yet, I recommend you go and &lt;a href="http://www.autodesk.com/symbreg/" target="_blank"&gt;register a Developer Symbol on the Autodesk website&lt;/a&gt; ASAP. Developer Symbols (aka Vendor ID) are 4 characters in length, meaning there is a limited number of combinations. In the end, it doesn’t really matter what combination you choose, but it would certainly be nice to have one that relates to your company wouldn’t it? The example Autodesk uses is ADSK for their vendor ID. &lt;/p&gt;  &lt;p&gt;Head on over and register it today, it’s really easy, you just need to fill out a form like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TZFI2BUTW1I/AAAAAAAAALA/zE_TNcnrvoo/s1600-h/image%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TZFI4Oa4fnI/AAAAAAAAALE/LGM5QdyfrNw/image_thumb%5B2%5D.png?imgmax=800" width="709" height="584" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Though a point to note, this page says that all fields in Bold are required, and the fax number is in bold. Before you begin on a rant on how we should be in the 21st century and a fax number should not be required, relax, this is an error – you don’t need to enter in a fax number. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/M3OZ1RIpIwY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/6508347013120928428/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=6508347013120928428" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/6508347013120928428?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/6508347013120928428?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/M3OZ1RIpIwY/revit-apirevit-2012-and-vendor-ids.html" title="[Revit API]–Revit 2012 and Vendor IDs" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_PZEkMtbO9tU/TZFI4Oa4fnI/AAAAAAAAALE/LGM5QdyfrNw/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/03/revit-apirevit-2012-and-vendor-ids.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIAR385eip7ImA9WhZSEE8.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-7039385141484618775</id><published>2011-03-25T07:58:00.000+10:00</published><updated>2011-03-25T13:09:06.122+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-25T13:09:06.122+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit]–Journal File Analyzer–Free Utility to identify Keyboard Shortcut candidates</title><content type="html">&lt;p&gt;Luke Johnson runs a great Revit blog called &lt;a href="http://whatrevitwants.blogspot.com" target="_blank"&gt;‘What Revit Wants’&lt;/a&gt;, which is updated frequently with lots of good general Revit information. He recently &lt;a href="http://whatrevitwants.blogspot.com/2011/03/challenge-revit-productivity-monitoring.html" target="_blank"&gt;issued a challenge&lt;/a&gt; in regards to Journal file analyzing which I have (somewhat) answered. &lt;/p&gt;  &lt;p&gt;The result is a utility that I’ve developed that will take a look through your journal files and identify your most commonly used menu items, along with your most commonly used keyboard shortcuts. The idea is that you can run this utility and assess what commands you should add a keyboard shortcut to, in order to make your Revit usage more efficient. &lt;/p&gt;  &lt;p&gt;To run the utility, you simply open it, enter the correct location of your Journal files and (optionally) your keyboard shortcuts.xml location (it tries to auto detect this for you, but you may need to change Structure to Architecture in the path).&lt;/p&gt;  &lt;p&gt;Click Analyze and it will look through the journal files and tally up your 20 most commonly used commands with and without shortcuts..&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TYwE7uzP4pI/AAAAAAAAAK4/py9JaRr9i5g/s1600-h/image%5B4%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TYwE8vCLxkI/AAAAAAAAAK8/PKkhTUypJOA/image_thumb%5B2%5D.png?imgmax=800" width="696" height="426" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;An example output for Top Shortcuts used is as follows:&lt;/p&gt;  &lt;p&gt;Create a straight detail line or a detail arc , DL&amp;#160; - 120 times    &lt;br /&gt;Control visibility and appearance of objects (applied only in the active view) , VG&amp;#160; - 116 times     &lt;br /&gt;Trim/Extend two lines or walls to make a corner. , TR&amp;#160; - 88 times     &lt;br /&gt;Create a line , XD&amp;#160; - 82 times     &lt;br /&gt;Create Aligned Dimensions , DD#DA&amp;#160; - 75 times     &lt;br /&gt;Create a text object , T3&amp;#160; - 69 times     &lt;br /&gt;Create a detail component , DC&amp;#160; - 65 times     &lt;br /&gt;Redraw everything as large as fits into window , ZF#ZE&amp;#160; - 56 times     &lt;br /&gt;Align references. , AL&amp;#160; - 39 times     &lt;br /&gt;Draw all lines as thin lines. This does not affect printing. , TL&amp;#160; - 36 times     &lt;br /&gt;Trim/Extend multiple lines or walls to the same bounding reference. , EX&amp;#160; - 34 times     &lt;br /&gt;Create a default 3D orthographic view. , 3D&amp;#160; - 34 times     &lt;br /&gt;Split walls and lines , ES#SPL&amp;#160; - 26 times     &lt;br /&gt;Manage Links , ML&amp;#160; - 24 times     &lt;br /&gt;Change style of selected lines , LW&amp;#160; - 22 times     &lt;br /&gt;Copy the type of one object to other objects , MT#MA&amp;#160; - 21 times     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;What this is saying, is the general name of the command, followed by the keyboard shortcut for that command (as long as you have linked in your shortcuts file) followed by how many times you used that command.&lt;/p&gt;  &lt;p&gt;On the right is the display of the top commands used that weren’t started from a keyboard shortcut:&lt;/p&gt;  &lt;p&gt;&amp;quot;Undo the last action , ID_BUTTON_UNDO&amp;quot; - 37 times    &lt;br /&gt;&amp;quot;Move selected objects or their copies , ID_EDIT_MOVE&amp;quot; - 23 times     &lt;br /&gt;&amp;quot;Show or hide recent files , ID_STARTUP_PAGE&amp;quot; - 20 times     &lt;br /&gt;&amp;quot;Move copies of selected objects , ID_EDIT_MOVE_COPY&amp;quot; - 8 times     &lt;br /&gt;&amp;quot;Finish the family , ID_END_INPLACE_FAMILY&amp;quot; - 8 times     &lt;br /&gt;&amp;quot;Prevent change of element position , ID_LOCK_ELEMENTS&amp;quot; - 8 times     &lt;br /&gt;&amp;quot;Save the active project back to the Central File , ID_FILE_SAVE_TO_MASTER_SHORTCUT&amp;quot; - 6 times     &lt;br /&gt;&amp;quot;Save the active project with a new name , ID_REVIT_FILE_SAVE_AS&amp;quot; - 5 times     &lt;br /&gt;&amp;quot;Open an existing project , ID_REVIT_FILE_OPEN&amp;quot; - 5 times     &lt;br /&gt;&amp;quot; , ID_FILE_CADFORMAT_LINK&amp;quot; - 5 times     &lt;br /&gt;&amp;quot;Finish Sketch , ID_FINISH_SKETCH&amp;quot; - 4 times     &lt;br /&gt;&amp;quot;Redo the next action , ID_BUTTON_REDO&amp;quot; - 4 times     &lt;br /&gt;&amp;quot;Save the active project , ID_REVIT_FILE_SAVE&amp;quot; - 3 times     &lt;br /&gt;&amp;quot; , ID_REVIT_SAVE_AS_FAMILY&amp;quot; - 2 times     &lt;br /&gt;&amp;quot;Pick Lines , IDC_RADIO_COPY_CURVE&amp;quot; - 2 times     &lt;br /&gt;&amp;quot;Review previously posted warnings , ID_REVIEW_WARNINGS&amp;quot; - 1 times     &lt;br /&gt;&amp;quot;Purge (delete) unused families and types , ID_PURGE_UNUSED&amp;quot; - 1 times     &lt;br /&gt;&amp;quot;Create a rectangle , ID_OBJECTS_CURVE_RECT&amp;quot; - 1 times     &lt;br /&gt;&amp;quot;Modify predefined types for this family , ID_FAMILY_TYPE&amp;quot; - 1 times     &lt;br /&gt;&amp;quot;Quit in place family , ID_QUIT_INPLACE_FAMILY&amp;quot; - 1 times     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;You can see here the name of the command, it’s ID and how many times you’ve used it.&lt;/p&gt;  &lt;p&gt;The ‘Include Context Menu Entries’ checkbox is used for if you want to include commands that were fired from menus like the right click menu – which often you can’t create a keyboard shortcut for, but sometimes you can (Save To Central shows up in this listing). &lt;/p&gt;  &lt;p&gt;To download the tool and run it on your own download it from &lt;a href="http://rodhowarth.com/downloads/software/JournalAnalyzer.zip" target="_blank"&gt;HERE&lt;/a&gt;. Let me know how it goes for you!&lt;/p&gt;  &lt;p&gt;Also, if you are interested in the source code, it’s &lt;a href="https://github.com/RodH257/RevitJournalAnalyzer" target="_blank"&gt;available on GitHub&lt;/a&gt;. If you don’t have Git (you should check it out!) you can download the source code as a Zip. If you want to modify the code feel free to send me a Push request! &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/xZXjMe1B_Ss" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/7039385141484618775/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=7039385141484618775" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/7039385141484618775?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/7039385141484618775?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/xZXjMe1B_Ss/revitjournal-file-analyzerfree-utility.html" title="[Revit]–Journal File Analyzer–Free Utility to identify Keyboard Shortcut candidates" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/_PZEkMtbO9tU/TYwE8vCLxkI/AAAAAAAAAK8/PKkhTUypJOA/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/03/revitjournal-file-analyzerfree-utility.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YMQ3k4cSp7ImA9Wx9aFE8.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-8112539877017169678</id><published>2011-03-07T00:19:00.001+10:00</published><updated>2011-03-07T00:19:42.739+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-07T00:19:42.739+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Revit-API" /><category scheme="http://www.blogger.com/atom/ns#" term="Revit" /><title>[Revit] Tic Tac Toe for Revit with online play</title><content type="html">&lt;p&gt;This is a ‘for fun’ project that I have been working on this week. It started out as something interesting to code while I was up late due to having too many coffees, but then I decided to add a few more features to it throughout the week.&lt;/p&gt;  &lt;p&gt;The game is a version of Tic Tac Toe (naughts and crosses) using rooms in Revit as the squares. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TXOXeikAgbI/AAAAAAAAAI8/YUUGLWyEMsY/s1600-h/image%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOXf7vBQOI/AAAAAAAAAJA/wU7nygZgnPM/image_thumb%5B2%5D.png?imgmax=800" width="649" height="511" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The game can be played either locally, or online via sever connection. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TXOXgr3dO8I/AAAAAAAAAJE/7aX60W2AtH0/s1600-h/image%5B9%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TXOXhSnZeKI/AAAAAAAAAJI/fH6x5uAQ-QI/image_thumb%5B5%5D.png?imgmax=800" width="523" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The local game is intended to be played by two people sitting at the same computer, swapping the mouse between each other in between turns. When the game starts, the user must click inside the room that they wish to place their X or O in:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TXOXi-Lee2I/AAAAAAAAAJM/4ZJowL8xTIc/s1600-h/image%5B13%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TXOXjlRQDrI/AAAAAAAAAJQ/nJaSSEm0Z-8/image_thumb%5B7%5D.png?imgmax=800" width="422" height="330" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then it is the other players turn, and so on until the game is won, or all rooms are filled. When the game is won, the text notes on the view are updated to add to the score:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TXOXkYxInlI/AAAAAAAAAJU/rgF59haadPE/s1600-h/image%5B19%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOXlJtIIDI/AAAAAAAAAJY/qPXVNC475LA/image_thumb%5B11%5D.png?imgmax=800" width="526" height="480" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After getting this working, I decided I could try and take it one step further, by adding online play. To play this the user selects online play when starting the game, and then they must either create or join a new session:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TXOXltydD4I/AAAAAAAAAJc/wQWzOevY5Ak/s1600-h/image%5B24%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TXOXmgVolgI/AAAAAAAAAJg/XClY7k_PCK8/image_thumb%5B14%5D.png?imgmax=800" width="455" height="281" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Clicking Create New Session will get a new session ID from the server. &lt;/p&gt;        &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOXnRP3xoI/AAAAAAAAAJk/1a___yXoLpA/s1600-h/image%5B28%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TXOXoMyTXLI/AAAAAAAAAJo/sQC9zYi2PRc/image_thumb%5B16%5D.png?imgmax=800" width="329" height="154" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That session ID must be then passed to the opponent who enters it in the textbox on the same screen. Once both people are ready, click ‘Start Game’. &lt;/p&gt;  &lt;p&gt;The game then plays out in a similar way to the local game, but after each turn you’ll see the ‘waiting on other player’ screen:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TXOXo8VHiDI/AAAAAAAAAJs/VBfiAUctZSo/s1600-h/image%5B32%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TXOXpgzHX1I/AAAAAAAAAJw/H80wJ-8883U/image_thumb%5B18%5D.png?imgmax=800" width="285" height="144" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When the other player takes their turn, your view will be updated with their input.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TXOXq96HTpI/AAAAAAAAAJ0/1DvbnISn2ZQ/s1600-h/image%5B37%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOXrwMRKhI/AAAAAAAAAJ4/8Mi2CTg6Fik/image_thumb%5B21%5D.png?imgmax=800" width="449" height="356" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This continues until the game is won or board is filled.&lt;/p&gt;  &lt;p&gt;   &lt;hr /&gt;To install the game, download it from &lt;a href="http://rttt.punchyn.com/RevitTicTacToe.zip" target="_blank"&gt;HERE&lt;/a&gt; and unzip the files to C:\RevitTicTacToe\. Then move the TicTacToe-Manifest.addin file to your Revit Addins directory, which will be one of the following:&lt;/p&gt;  &lt;p&gt;Vista/7 Users:   &lt;br /&gt;C:\ProgramData\Autodesk\Revit\Addins\2011     &lt;br /&gt;    &lt;br /&gt;XP Users:    &lt;br /&gt;C:\Documents and Settings\All Users\Application Data\Autodesk\Revit\Addins\2011\&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TXOXsqudmqI/AAAAAAAAAJ8/dxs0C9wtrus/s1600-h/image%5B50%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TXOXtkeljSI/AAAAAAAAAKA/r23_OWr5TBc/image_thumb%5B28%5D.png?imgmax=800" width="454" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOXvXHrsfI/AAAAAAAAAKE/nX6B7UwfAzc/s1600-h/image%5B46%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOX2UDLGuI/AAAAAAAAAKI/zQolr3hmMWw/image_thumb%5B26%5D.png?imgmax=800" width="454" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then simply open GameBoard.rvt from C:\RevitTicTacToe\ and run the the addin from Add-Ins tab, External Tools menu:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TXOX8c_inLI/AAAAAAAAAKM/lkt_JgO641s/s1600-h/image%5B53%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOX_cEPS8I/AAAAAAAAAKQ/Sje5THV-pTo/image_thumb%5B29%5D.png?imgmax=800" width="240" height="127" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;While this is a bit of a silly project, it was a bit of fun, and I got to use a few cool techniques which will form the base of some blog posts to come, including manual transactions in Revit, RESTful web services in ASP.NET MVC, interacting with rooms via the API, making web requests from Revit and more. &lt;/p&gt;  &lt;p&gt;When showing an early version of this game to some Revit users it was mentioned that they believed some of this functionality could be implemented in a Revit family, I mentioned to &lt;a href="http://jasongrant.squarespace.com/" target="_blank"&gt;Jason Grant&lt;/a&gt; on Twitter that I’d love to see if any expert Revit Family makers can rise to the challenge and give a working version of Tic Tac Toe in a family! &lt;/p&gt;  &lt;p&gt;Feel free to give the game a go, let me know if you find any bugs in it. If you want to take a look at the source code, &lt;a href="https://github.com/RodH257/RevitTicTacToe" target="_blank"&gt;it’s available on GitHub&lt;/a&gt;. You can download it all using the Git verison control system, or you can click on files online to view them in browser. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/UupwDjHNn_o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/8112539877017169678/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=8112539877017169678" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8112539877017169678?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8112539877017169678?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/UupwDjHNn_o/revit-tic-tac-toe-for-revit-with-online.html" title="[Revit] Tic Tac Toe for Revit with online play" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_PZEkMtbO9tU/TXOXf7vBQOI/AAAAAAAAAJA/wU7nygZgnPM/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/03/revit-tic-tac-toe-for-revit-with-online.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ECQH47eip7ImA9Wx9aEEg.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-8533994176035813934</id><published>2011-03-02T17:41:00.000+10:00</published><updated>2011-03-02T17:41:01.002+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-02T17:41:01.002+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mvc" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>[ASP.NET MVC]–Custom DisplayFor partial view for IEnumerable&lt;T&gt;</title><content type="html">&lt;p&gt;&lt;em&gt;-------------------------------------------------------------     &lt;br /&gt;Notice: This is a post related to ASP.NET MVC version 3. If you are a regular reader of this blog who is only interested in Revit API posts, please change your RSS subscription to the new ‘Revit Only Feed’ – see &lt;a href="http://blog.rodhowarth.com/2011/02/housekeeping-new-revit-only-rss-blog.html" target="_blank"&gt;this post&lt;/a&gt; for more information.      &lt;br /&gt;&lt;/em&gt;&lt;em&gt;-------------------------------------------------------------     &lt;br /&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In ASP.NET MVC, you can generate a HTML display for a model property by using Html.DisplayFor(model =&amp;gt; model.Property); however you may want to create a custom partial view for this display rather than use the default output. &lt;/p&gt;  &lt;p&gt;To do this, create a folder called DisplayTemplates under Views/ControllerName and add your partial view in there. To make it automatically choose this template for a certain type of object, you need to name it the name of the Type. For simple types, this is fine, but what about IEnumerable&amp;lt;SomeObject&amp;gt;? Naming your files like this is likely to have problems. &lt;/p&gt;  &lt;p&gt;We can get around this with DataAnnotations. In your model, import the System.ComponentModel.DataAnnotations namespace and add [UIHint(“Name”)] attribute to your property, like this:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[UIHint(&lt;span style="color: #006080"&gt;&amp;quot;ProjectsList&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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; IEnumerable&amp;lt;Projects&amp;gt; ProjectsList { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Then we can simply create a partial view called ProjectsList in the DisplayTemplates directory&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TW3Yrvjh_pI/AAAAAAAAAI0/skvFQciDDno/s1600-h/image%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TW3YsSs9DjI/AAAAAAAAAI4/mDoxQV4Ty1g/image_thumb%5B2%5D.png?imgmax=800" width="272" height="83" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then in your view you can simply use:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;@Html.DisplayFor(model =&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; model.ProjectsList);&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And your partial view will be used. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/owUHe_76BIg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/8533994176035813934/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=8533994176035813934" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8533994176035813934?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/8533994176035813934?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/owUHe_76BIg/aspnet-mvccustom-displayfor-partial.html" title="[ASP.NET MVC]–Custom DisplayFor partial view for IEnumerable&amp;lt;T&amp;gt;" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_PZEkMtbO9tU/TW3YsSs9DjI/AAAAAAAAAI4/mDoxQV4Ty1g/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/03/aspnet-mvccustom-displayfor-partial.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYCQXw5fCp7ImA9Wx9aEEg.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-6351791730936485538</id><published>2011-03-02T17:16:00.000+10:00</published><updated>2011-03-02T17:16:00.224+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-02T17:16:00.224+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC" /><category scheme="http://www.blogger.com/atom/ns#" term="asp.net" /><title>[ASP.NET MVC]–Defining Multiple Layout Sections with Razor View Engine</title><content type="html">&lt;p&gt;When using MasterPages in ASP.NET web forms you can create a number of ‘ContentPlaceHolder’ sections that allow you to have various editable sections in your template. One example is that you may have something like:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackgroundTop&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackground&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:ContentPlaceHolder&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;HeadingPlaceHolder&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:ContentPlaceHolder&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackgroundMiddle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackground&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:ContentPlaceHolder&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;PagePlaceHolder&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;runat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asp:ContentPlaceHolder&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Which lets you have a separate div for your page heading text, and then a div below it for the rest of your content. I recently started using Razor view engine in ASP.NET MVC and was interested in doing a similar thing, here’s how. &lt;/p&gt;

&lt;p&gt;The Razor equivalent of master pages is a _Layout.cshtml file. which by default has a @RenderBody() call to do the rendering of your view. However I wanted to have another section to render different text, so I added the following to my layout:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackgroundTop&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackground&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    @RenderSection(&amp;quot;Heading&amp;quot;, false)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackgroundMiddle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;contentBackground&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    @RenderBody()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;As you can see, I’ve added a called to @RenderSection, which takes 2 parameters, the first being the name of the section, the second being a boolean as to whether it’s optional or not – this is very handy as ASP.NET Web Forms forces it to be compulsory. &lt;/p&gt;

&lt;p&gt;For my Body content, my view stays the same, except I added the following code to render the Heading section:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;@section Heading&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; 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;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;       Heading Goes Here&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
This is a nice, neat syntax which you can just add to the top of your view. 








  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/a1wWzwsJLPI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/6351791730936485538/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=6351791730936485538" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/6351791730936485538?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/6351791730936485538?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/a1wWzwsJLPI/aspnet-mvcdefining-multiple-layout.html" title="[ASP.NET MVC]–Defining Multiple Layout Sections with Razor View Engine" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/03/aspnet-mvcdefining-multiple-layout.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcHR3c4eSp7ImA9Wx9bFk0.&quot;"><id>tag:blogger.com,1999:blog-5096437112654914738.post-3047548401702965520</id><published>2011-02-25T07:55:00.000+10:00</published><updated>2011-02-25T14:27:16.931+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-25T14:27:16.931+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="General-Dev" /><category scheme="http://www.blogger.com/atom/ns#" term="nuget" /><category scheme="http://www.blogger.com/atom/ns#" term="nhibernate" /><title>[General-Dev]–FluentNHibernate cannot load NHibernate assembly when setup with NuGet</title><content type="html">&lt;p&gt;I ran into this issue today after using NuGet for the first time. I started a new project using NHibernate and I wanted to configure my mappings using Fluent NHibernate. NuGet makes setting up your references really easily, by right clicking on my references folder and going to Add Library Package Reference I could easily search for NHibernate and Fluent NHibernate and install them. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TWcvn_8xugI/AAAAAAAAAIs/tyCxxPF16YM/s1600-h/image%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TWcvo4klDeI/AAAAAAAAAIw/_-JxUEag24M/image_thumb%5B2%5D.png?imgmax=800" width="592" height="411" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Very impressive – and certainly much easier than on my last NHibernate project which pushed me into DLL hell to get it setup! But, the DLL pain wasn’t quite gone – when trying to run my project after setting up the mappings I got the following error:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Could not load file or assembly &lt;span style="color: #006080"&gt;'NHibernate, Version=3.0.0.2001, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'&lt;/span&gt; or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;What? Isn’t NuGet meant to save me from this? well, turns out that it does, but I have to give it a push. To work around this, I had to open up the Package Manager Console (Tools &amp;gt; Library Package Manager &amp;gt; Package Manager Console) and typed the following:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; 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: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Add-BindingRedirect&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This redirects the bindings to the newer version of NHibernate which was installed by NuGet, whereas the Fluent NHibernate references was pointing to a slightly earlier build. I’m not sure why NuGet doesn’t do this by default, but &lt;a href="http://stackoverflow.com/questions/4774236/fluentnhibernate-and-nuget-problem-with-nh-version/4780195#4780195" target="_blank"&gt;this Stack Overflow answer&lt;/a&gt; seems to suggest they will do this soon. &lt;/p&gt;  &lt;img src="http://feeds.feedburner.com/~r/rodh257/~4/Wt046lI2vuo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.rodhowarth.com/feeds/3047548401702965520/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5096437112654914738&amp;postID=3047548401702965520" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/3047548401702965520?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5096437112654914738/posts/default/3047548401702965520?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/rodh257/~3/Wt046lI2vuo/general-devfluentnhibernate-cannot-load.html" title="[General-Dev]–FluentNHibernate cannot load NHibernate assembly when setup with NuGet" /><author><name>Rod Howarth</name><uri>http://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/_PZEkMtbO9tU/TWcvo4klDeI/AAAAAAAAAIw/_-JxUEag24M/s72-c/image_thumb%5B2%5D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.rodhowarth.com/2011/02/general-devfluentnhibernate-cannot-load.html</feedburner:origLink></entry></feed>
