<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="https://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' xmlns:blogger='http://schemas.google.com/blogger/2008'><id>tag:blogger.com,1999:blog-5096437112654914738</id><updated>2025-01-04T05:43:38.030+10:00</updated><category term='KVM'/><category term='General-Dev'/><category term='2009'/><category term='server'/><category term='database'/><category term='Enhanced'/><category term='delay'/><category term='files'/><category term='Parameters'/><category term='Doc'/><category term='I-Drop'/><category term='Facebook'/><category term='ps2'/><category term='WDS'/><category term='wireless'/><category term='Vista performance'/><category term='bad'/><category term='RIS'/><category term='Status'/><category term='cricket'/><category term='asp.net'/><category term='web-forms'/><category term='life cycle'/><category term='cache'/><category term='WPF'/><category term='Two'/><category term='Vista'/><category term='Synergy'/><category term='Keyboard'/><category term='Vista BatchFiles'/><category term='Fxcop'/><category term='git'/><category term='Security'/><category term='Search'/><category term='Sharepoint'/><category term='Multiple-Monitors'/><category term='Flash'/><category term='Custom Attributes'/><category term='Usability'/><category term='Netlimiter'/><category term='OCR'/><category term='WSS'/><category term='Autocad'/><category term='DWF'/><category term='mvc'/><category term='.Net'/><category term='printing'/><category term='Revit-API'/><category term='Code-Style'/><category term='nhibernate'/><category term='Deployment'/><category term='nuget'/><category term='source'/><category term='Laptop'/><category term='visual-studio'/><category term='Computers'/><category term='Registration'/><category term='Mouse'/><category term='Design Review'/><category term='Menus'/><category term='EXE'/><category term='Exchange'/><category term='HTML'/><category term='Entities'/><category term='Click OK'/><category term='Indexing'/><category term='Simple OCR'/><category term='Windows'/><category term='DSOFile'/><category term='Caspol'/><category term='JPEG'/><category term='Office 2007'/><category term='AU2010'/><category term='web applications'/><category term='Blogger'/><category term='javascript'/><category term='Housekeeping'/><category term='MVC'/><category term='Word'/><category term='Web Parts'/><category term='Outlook'/><category term='Hostname'/><category term='mobile'/><category term='Simple'/><category term='ios'/><category term='Programming'/><category term='SMS'/><category term='logitech'/><category term='operating system'/><category term='Gaming'/><category term='General-IT'/><category term='COD4'/><category term='IE6'/><category term='Custom Forms'/><category term='Revit-Server'/><category term='2003'/><category term='C#'/><category term='Configuration'/><category term='Scan'/><category term='Revit'/><category term='Group Policy'/><category term='SQL'/><category term='ajax'/><category term='data'/><category term='Users Opinion'/><category term='SWF'/><category term='cordless'/><category term='2010'/><category term='Compatibility'/><category term='64bit'/><category term='Twitter'/><category term='excel'/><category term='API'/><title type='text'>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/-/Revit'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/-/Revit'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/search/label/Revit'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/-/Revit/-/Revit?start-index=26&amp;max-results=25'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><generator version='7.00' uri='https://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/2150497065721280681' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/2150497065721280681'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/2150497065721280681'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/10/revit-html-version-of-silverlight-revit.html' title='[Revit]– HTML Version of the Silverlight Revit Server Administrator Tool'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></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></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/9006472877789102562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/9006472877789102562'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/9006472877789102562'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/09/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>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/2354881841635437238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/2354881841635437238'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/2354881841635437238'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/09/revit-autodesk-university-2011-virtual.html' title='[Revit]– Autodesk University 2011 Virtual Class: Automating Autodesk Revit Server'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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.</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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/8186409858969838243' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/8186409858969838243'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/8186409858969838243'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/08/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>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></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>1</thr:total></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/2026469355260143399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/2026469355260143399'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/2026469355260143399'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/05/revit-apiapi-wishlists.html' title='[Revit API]–API Wishlists'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/7160403525007269610' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/7160403525007269610'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/7160403525007269610'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/05/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>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></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></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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.</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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/8392846812590986343' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/8392846812590986343'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/8392846812590986343'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/04/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>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>6</thr:total></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/4653432121645268254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/4653432121645268254'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/4653432121645268254'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/04/revitwhere-have-journal-files-gone-in.html' title='[Revit]–Where have the journal files gone in Revit 2012?'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></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></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/7039385141484618775' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/7039385141484618775'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/7039385141484618775'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/03/revitjournal-file-analyzerfree-utility.html' title='[Revit]–Journal File Analyzer–Free Utility to identify Keyboard Shortcut candidates'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></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>4</thr:total></entry><entry><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><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[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;  </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='https://www.blogger.com/comment/fullpage/post/5096437112654914738/8112539877017169678' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/8112539877017169678'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/8112539877017169678'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/03/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>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></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></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-228630976341441044</id><published>2011-02-13T12:37:00.001+10:00</published><updated>2011-02-13T12:37:04.571+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Housekeeping'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><title type='text'>[Housekeeping]– New Revit only RSS blog feed available</title><content type='html'>&lt;p&gt;Many of you may be reading this post via an RSS feed reader from the blogs &lt;a href="http://feeds.feedburner.com/rodh257" target="_blank"&gt;main feed.&lt;/a&gt; If you are reading the blog purely for the Revit API content, and don’t want to see my posts on other programming topics, I’ve created a custom RSS feed that will only display blog posts that are labelled ‘Revit’. &lt;/p&gt;  &lt;p&gt;You will now see to the right of my blog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://feeds.feedburner.com/rodh257"&gt;&lt;img alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon32x32.png" /&gt;&lt;/a&gt;&lt;a href="http://feeds.feedburner.com/rodh257"&gt;Subscribe to all posts&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://feeds.feedburner.com/Rodh257-Revit"&gt;&lt;img alt="" src="http://www.feedburner.com/fb/images/pub/feed-icon32x32.png" /&gt;&lt;/a&gt;&lt;a href="http://feeds.feedburner.com/Rodh257-Revit"&gt;Subscribe only to Revit related posts&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Feel free to update your reader to the Revit only post if you wish. I am planning on adding more and more posts on other development topics, including ASP.NET MVC and mobile application development (Android initially, but perhaps IOS later on). If you aren’t interested in these topics, register to the Revit only feed! &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/228630976341441044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/228630976341441044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/228630976341441044'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/228630976341441044'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/housekeeping-new-revit-only-rss-blog.html' title='[Housekeeping]– New Revit only RSS blog feed available'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-6187197447750016104</id><published>2011-02-13T10:19:00.000+10:00</published><updated>2011-02-13T10:19:17.511+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[Revit API]–Introduction to VSTA as a rapid prototyping tool</title><content type='html'>At Autodesk University in December some of the Autodesk Revit API team were mentioning that they thought VSTA was a little underappreciated by Revit API developers, and that it is a very useful too, particularly for working things out before turning them into fully fledged applications.&lt;br /&gt;
&lt;br /&gt;
I must say that I’ve always steered clear of VSTA, for a number of reasons, firstly it used to lack a few features, and secondly that I’ve always preferred the full Visual Studio professional as I can use plugins like the wonderful &lt;a href="http://www.jetbrains.com/resharper/" target="_blank"&gt;Resharper&lt;/a&gt; plugin. However, there are disadvantages to this, namely that you generally have to reboot Revit after each code change. I’ve purchased a good quality Solid State Drive in order to make Revit boot quickly, which has made this disadvantage bearable, and there &lt;a href="http://thebuildingcoder.typepad.com/blog/2010/03/reload-an-addin-to-debug.html" target="_blank"&gt;are some techniques to try and avoid restarting Revit all the time&lt;/a&gt; but it’s still not ideal.&lt;br /&gt;
&lt;br /&gt;
Enter VSTA. I recently decided to give it a try to quickly answer a question someone asked me via email. To get started using it, you need to install it from the Revit disk. After this, you should be able to open a document and go to the Manage ribbon tab and go to ‘Macro Manager’. This is somewhat confusing, as all non VSTA addins go in the ‘addins’ tab. &lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLitYsr3I/AAAAAAAAAGQ/E6c8SweMOg0/s1600-h/image%5B2%5D.png"&gt;&lt;img alt="image" border="0" height="118" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLjcPls5I/AAAAAAAAAGU/Fov0lE9ZxII/image_thumb.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="144" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You will then see the Macro Manager, which lets you create either an Application level macro, or a Document level (ie the code is included in the actual Revit file you have open). To do some rapid prototyping we’ll create a document level macro by clicking on the tab that is named the same as your Revit file. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TVTLj9HyZ9I/AAAAAAAAAGY/qUF8irzKo7E/s1600-h/image%5B7%5D.png"&gt;&lt;img alt="image" border="0" height="348" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TVTLkuiFAAI/AAAAAAAAAGc/ci1qnllaMvg/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="659" /&gt;&lt;/a&gt;&lt;br /&gt;
Here you’ll see a couple of tools I’ve made, to create a new one click ‘Create Module’ which opens a dialog box asking you to name your new Module.&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLlPa0-eI/AAAAAAAAAGg/T6ez2KWjEN8/s1600-h/image%5B11%5D.png"&gt;&lt;img alt="image" border="0" height="324" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TVTLlihZkyI/AAAAAAAAAGk/ePnhpmX2OCk/image_thumb%5B5%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="310" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This create a new module in the list. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TVTLmO8pPdI/AAAAAAAAAGo/jtvs0tVHheY/s1600-h/image%5B15%5D.png"&gt;&lt;img alt="image" border="0" height="71" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLmgraqbI/AAAAAAAAAGs/c_E7ICHnApw/image_thumb%5B7%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="577" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Click on it, then Click Create ‘Macro’.&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLnXIFA7I/AAAAAAAAAGw/klZXJmWIksM/s1600-h/image%5B20%5D.png"&gt;&lt;img alt="image" border="0" height="330" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLn7l9TgI/AAAAAAAAAG0/JwurDe0Z2cQ/image_thumb%5B10%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="311" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This will create a new instance of VSTA, which is a cut down version of Visual Studio 2008. &lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLo48vFhI/AAAAAAAAAG4/t68wNPQU6jM/s1600-h/image%5B25%5D.png"&gt;&lt;img alt="image" border="0" height="438" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLpn-SDjI/AAAAAAAAAG8/G3qrL8pxag4/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="708" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You can see here it has created a HelloWorld method which represents your macro, in addition to that there’s the usual Attributes you’d see on an External Command, and also the AddInID GUID is created – no need for you to set this up. There’s also Module_Startup and Shutdown methods which let you run some code which happens before or after every macro in the module. For now, we’ll just concentrate on the HelloWorld method. &lt;br /&gt;
To show a simple dialog box, first we need to import the Autodesk.Revit.UI namespace at the top, and then we can add in our Task Dialog code:&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;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; HelloWorld()&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;    TaskDialog.Show(&lt;span style="color: #006080;"&gt;"Hello World"&lt;/span&gt;,&lt;span style="color: #006080;"&gt;"Hello World"&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;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Now, to run this code first we need to build it, go to Build &amp;gt; Build Example. Then swap back to the Macro Manager and you’ll see the Example module can be expanded out to see all the macros underneath it. &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TVTLqADZ38I/AAAAAAAAAHA/hjTpROzyBo0/s1600-h/image%5B30%5D.png"&gt;&lt;img alt="image" border="0" height="334" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TVTLq6MiBNI/AAAAAAAAAHE/Z0BMTPWe_do/image_thumb%5B16%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="634" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
We can select that macro and click ‘Run’ to run it, or Step Into if we want to debug it.&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLr5sz_mI/AAAAAAAAAHI/sheiJms6ASE/s1600-h/image%5B34%5D.png"&gt;&lt;img alt="image" border="0" height="128" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLsiqm3QI/AAAAAAAAAHM/RGzXMaU3jQU/image_thumb%5B18%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="323" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see it works fine. Now lets create one that does something a little different. Say we have a detail line on our document, like one from &lt;a href="http://blog.rodhowarth.com/2011/02/revit-api-how-to-draw-detail-line-on.html"&gt;my previous post that creates a detail line:&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TVTLtPtHyQI/AAAAAAAAAHQ/WOq1PPiBHDI/s1600-h/image%5B38%5D.png"&gt;&lt;img alt="image" border="0" height="281" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLtk4clFI/AAAAAAAAAHU/_7H-o469e1c/image_thumb%5B20%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="405" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And we want to know how to access the length of it in millimetres through the API. Here’s a workflow we can use to do that.&lt;br /&gt;
First, create a new macro under the Example module called GetLength&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TVTLufu-OWI/AAAAAAAAAHY/Z6rXtiNPC3o/s1600-h/image%5B42%5D.png"&gt;&lt;img alt="image" border="0" height="315" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLu_ljw6I/AAAAAAAAAHc/hMGzISj4VK4/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="301" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You should see it creates another public void for that macro. (You can create macros just by creating the methods yourself if you like) &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLvwe301I/AAAAAAAAAHg/_W1_08svuf8/s1600-h/image%5B48%5D.png"&gt;&lt;img alt="image" border="0" height="554" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TVTLwlqf3lI/AAAAAAAAAHk/yQG0UH_ouag/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="693" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now, we want to figure out how to access the length. If you have two monitors (if you don’t, you should!) put the VSTA code on one window and on the other, select your detail line. To work out how to access this value, we can use RevitLookup, if you haven’t installed it, grab it from the SDK and install it – it’s essential for Revit API development. &lt;br /&gt;
Go to the add-ins tab, go to Revit Lookup and snoop the current selection. You’ll see the API’s view of this element&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TVTLxEQZhXI/AAAAAAAAAHo/SmKw1ZWWEPo/s1600-h/image%5B53%5D.png"&gt;&lt;img alt="image" border="0" height="411" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLx7OPPtI/AAAAAAAAAHs/iOEVzRu19oI/image_thumb%5B29%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="564" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Click on the ParameterSet and you’ll see there is a parameter called Length.&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLyhlGqXI/AAAAAAAAAHw/IjuYqyNgno0/s1600-h/image%5B58%5D.png"&gt;&lt;img alt="image" border="0" height="385" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLzVRda1I/AAAAAAAAAH0/3Sp1oi949D8/image_thumb%5B32%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="572" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This is what we want to access. Swap to the other window, and lets access it via code. First off, we’ll&amp;nbsp; have to reference the Autodesk.Revit.DB namespace. Then, we need to get at both the Document and UIApplication objects. To do this in a VSTA macro, you can use this.Document and this.Application. However rather than writing this each time in the code, I like to extract these to a variable. That way if the code I’m prototyping here ends up as a full API tool I can easily move it to a Visual Studio solution.&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;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; GetLength()&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;    Document doc = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Document;&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;    UIApplication app = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Application;&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;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
We’ll use the currently selected element as a way of getting to the detail line, then we’ll read through its parameters looking for the length, and display it in a TaskDialog.&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;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; GetLength()&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;            Document doc = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Document;&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;            UIApplication app = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Application;&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;span style="color: blue;"&gt;foreach&lt;/span&gt; (Element selectedElement &lt;span style="color: blue;"&gt;in&lt;/span&gt; app.ActiveUIDocument.Selection.Elements)&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;span style="color: blue;"&gt;if&lt;/span&gt; (selectedElement &lt;span style="color: blue;"&gt;is&lt;/span&gt; DetailLine)&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;span style="color: green;"&gt;//the selected element is a detail line, so cast it to one.&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;                    DetailLine line = (DetailLine)selectedElement;&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: green;"&gt;//loop through all the parameters&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;foreach&lt;/span&gt; (Parameter parameter &lt;span style="color: blue;"&gt;in&lt;/span&gt; line.Parameters)&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;span style="color: blue;"&gt;if&lt;/span&gt; (parameter.Definition.Name.ToLower().Equals(&lt;span style="color: #006080;"&gt;"length"&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;/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: green;"&gt;//found the length parameter&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;                            TaskDialog.Show(&lt;span style="color: #006080;"&gt;"Length"&lt;/span&gt;, parameter.AsValueString());&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;/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;/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;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
To run this, go to Build &amp;gt; Build Example and then swap back to Revit, head into the Macro Manager and run your macro. As long as you have the line selected you should see the result flash up &lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TVTLzxhRUKI/AAAAAAAAAH4/3-z7vl-F5rA/s1600-h/image%5B63%5D.png"&gt;&lt;img alt="image" border="0" height="138" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TVTL0RBu-_I/AAAAAAAAAH8/INudWiqIFTg/image_thumb%5B35%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="341" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now you know how to access the length, you’ve experimented in VSTA, and you can convert this code over to your full blown Revit add-in that you have been working on, or planning to work on. 
  &lt;br /&gt;
&lt;br /&gt;
This has saved us a fair bit of time, instead of creating a new Visual Studio project, setting up our entry class, referencing the API, adding the transaction and regeneration attributes (and probably forgetting to do that once, starting Revit, having an error and then having to exit again), setting the references to not copy, setting up an addin manifest file, creating an addinID GUID etc we’ve just opened VSTA, and with the document still live in front of us we’ve written our code and tested it. &lt;br /&gt;
While it may not be so convenient when creating a comprehensive Revit addin, I believe VSTA is certainly very handy when just doing some trial and error coding to work out how to access things through the API.&amp;nbsp; For more examples on how to use VSTA, see the VSTA samples folder in the Revit SDK.</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/6187197447750016104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/6187197447750016104' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/6187197447750016104'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/6187197447750016104'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/revit-apiintroduction-to-vsta-as-rapid.html' title='[Revit API]–Introduction to VSTA as a rapid prototyping tool'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_PZEkMtbO9tU/TVTLjcPls5I/AAAAAAAAAGU/Fov0lE9ZxII/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-1085254440995898962</id><published>2011-02-12T13:29:00.000+10:00</published><updated>2011-02-12T13:29:54.474+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit-API'/><title type='text'>[Revit API] – How to draw a detail line on a view</title><content type='html'>I got asked a question similar to this so thought I’d post it up. To draw a detail line on a view, from one point to another, you first need to create a ‘Line’ and then a ‘DetailCurve’. &lt;br /&gt;
This may be a little confusing, but a ‘Line’ is not the actual end result, it’s a geometry object that represents where the line will go. To actually draw the line you need to create a DetailCurve, which is the actual Detail Line. &lt;br /&gt;
Here’s the code that I’m talking about:&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: green;"&gt;//Create the Points&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;double&lt;/span&gt; x1 = 5.0;&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;double&lt;/span&gt; y1 = 5.0;&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;double&lt;/span&gt; z = 0.0;&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;double&lt;/span&gt; x2 = 117.0;&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;double&lt;/span&gt; y2 = 115.0;&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;XYZ point1 = app.Application.Create.NewXYZ(x1, y1, z);&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;XYZ point2 = app.Application.Create.NewXYZ(x2, y2, z);&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;span style="color: green;"&gt;//Create line&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;Line line = app.Application.Create.NewLineBound(point1, point2);&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;DetailCurve detailCurve = doc.Create.NewDetailCurve(doc.ActiveView, line);&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;TaskDialog.Show(&lt;span style="color: #006080;"&gt;"Done"&lt;/span&gt;, &lt;span style="color: #006080;"&gt;"Line Created"&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
First off, we are setting up the XYZ for each point that we are going to draw between. These are points in the model. Then we use the NewLineBound method to create a bound line in space between point1 and point2. If you just stopped here, you would see nothing in your model. To actually draw the Detail Line you use the NewDetailCurve method to specify which view you want to draw the line on, and the line that represents it’s geometry. &lt;br /&gt;
To run the code you’ll need to be in a transaction (or use Automatic transaction mode), and need to initialize the app and doc variables as you normally would. When you run the tool, the final result is this:&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TVS1zpFuApI/AAAAAAAAAGI/ATEMQekQXFI/s1600-h/image%5B3%5D.png"&gt;&lt;img alt="image" border="0" height="302" src="http://lh6.ggpht.com/_PZEkMtbO9tU/TVS10SjkzCI/AAAAAAAAAGM/a5Pr5fz2wTw/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="383" /&gt;&lt;/a&gt;&lt;br /&gt;
A simple line drawn on the page.</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/1085254440995898962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/1085254440995898962' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/1085254440995898962'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/1085254440995898962'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/revit-api-how-to-draw-detail-line-on.html' title='[Revit API] – How to draw a detail line on a view'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_PZEkMtbO9tU/TVS10SjkzCI/AAAAAAAAAGM/a5Pr5fz2wTw/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-6905707870443937977</id><published>2011-02-07T10:05:00.000+10:00</published><updated>2011-02-07T10:05:34.155+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit API]–Hide Warnings in Revit using the API</title><content type='html'>&lt;p&gt;The general rule ever since the Revit API was released, is that whatever you can do in the API, you can also do through the normal user interface. &lt;/p&gt;  &lt;p&gt;In recent versions I’ve come across a few different examples of where the API is starting to let you do some things you can’t do through the interface (as far as I know – there may be a way I am missing!). One such example is interacting with warnings.&lt;/p&gt;  &lt;p&gt;Revit 2011 introduced the new Failures API. This API lets you do two things:&lt;/p&gt;  &lt;p&gt;1. Create new warnings within Revit&lt;/p&gt;  &lt;p&gt;2. Respond to warnings reported by Revit.&lt;/p&gt;  &lt;p&gt;I’m going to discuss option 2 today through a quick example. Lets say that you have a burning desire to place two walls in exactly the same position. Normally when you do this in Revit, you’ll get a warning that looks like the following: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_PZEkMtbO9tU/TUuU4huBK8I/AAAAAAAAAE0/sQsE6oflp3w/s1600-h/image%5B15%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/TUuU5Qrhq6I/AAAAAAAAAE4/ig7ks3aDfSM/image_thumb%5B7%5D.png?imgmax=800" width="437" height="129" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Which you can ignore. This is a bit of a silly example, but in many offices there may be warnings in Revit which you ALWAYS accept, and therefore having them in the warnings menu simple messes up the signal to noise ratio, and could mean that real warnings get lost in the crowd. &lt;/p&gt;  &lt;p&gt;To stop this warning from displaying, we can make use of the new failures API. To do this, we use an event called the FailuresProcessing event, so as per usual with events we need to make a new ExternalApplication and subscribe to that event:&lt;/p&gt;  &lt;p&gt;&amp;#160;&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; Result OnStartup(UIControlledApplication application)&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;    application.ControlledApplication.FailuresProcessing += ControlledApplication_FailuresProcessing;&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;return&lt;/span&gt; Result.Succeeded;&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;&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: 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; Result OnShutdown(UIControlledApplication application)&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;    application.ControlledApplication.FailuresProcessing -= ControlledApplication_FailuresProcessing;&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;return&lt;/span&gt; Result.Succeeded;&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;

&lt;p&gt;Whenever Revit does its failures checks, which is at a number of points in time, including after making our wall, or when opening the warnings menu, our ControlledApplication_FailuresProcessing method will get called. &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;void&lt;/span&gt; ControlledApplication_FailuresProcessing(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, Autodesk.Revit.DB.Events.FailuresProcessingEventArgs e)&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;       FailuresAccessor accessor = e.GetFailuresAccessor();&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;       IList&amp;lt;FailureMessageAccessor&amp;gt; messages = accessor.GetFailureMessages();&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; (FailureMessageAccessor failure &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; messages)&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;           FailureDefinitionId failId = failure.GetFailureDefinitionId();&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; (failId == BuiltInFailures.OverlapFailures.WallsOverlap)&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;               TaskDialog.Show(&lt;span style="color: #006080"&gt;&amp;quot;Deleting Failure&amp;quot;&lt;/span&gt;, failure.GetDescriptionText());&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;               accessor.DeleteWarning(failure);&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;In the code above, you get an object of type ‘FailuresAccessor’ which, funnily enough, lets you access the failures. &lt;/p&gt;

&lt;p&gt;Then you can get all of the failure messages and loop through them, then I use the BuiltInFailures listings to match the unique ID of each failure with the one that I’m looking for, that is BuiltInFailures.OverlapFailures.WallsOverlap. The WallsOverlap property simply returns a FailureDefintionId which is used when a WallsOverlap failure is added, so by comparing this with our ID we can find the failures we are after.&lt;/p&gt;

&lt;p&gt;If they match, I’m showing a task dialog (you may like to remove this, it’s just there for demonstration purposes) and deletes the warning. &lt;/p&gt;

&lt;p&gt;If you load Revit and try to create walls again you’ll see:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TUuU5zh34-I/AAAAAAAAAE8/5_LUr0NVWMc/s1600-h/image%5B14%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://lh3.ggpht.com/_PZEkMtbO9tU/TUuU6ZKOiUI/AAAAAAAAAFA/CvQdZt-v_S4/image_thumb%5B6%5D.png?imgmax=800" width="352" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and you won’t get the Revit warning. Take out the call to task dialog and you’ll always have the warning deleted silently – meaning it’s never displayed to the user. Fairly quickly and easily you can remove a certain failure from the list, and as long as your ExternalApplication is running in the background it will never show up.&lt;/p&gt;

&lt;p&gt;This can only be used for warnings, so errors can’t be simply deleted, however the Failures API has some neat options to do with automatically resolving errors, but that’s a topic for another day. &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/6905707870443937977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/6905707870443937977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/6905707870443937977'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/6905707870443937977'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/revit-apihide-warnings-in-revit-using.html' title='[Revit API]–Hide Warnings in Revit using the API'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_PZEkMtbO9tU/TUuU5Qrhq6I/AAAAAAAAAE4/ig7ks3aDfSM/s72-c/image_thumb%5B7%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-5380886948286713572</id><published>2011-02-04T21:12:00.003+10:00</published><updated>2011-02-05T10:58:14.021+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit]–Free API addin–Revit Save Reminder, alerts you when your save to central is complete.</title><content type='html'>A fair while ago, during AU 2009 I believe, I saw on Twitter that someone suggested it would be a great if someone could make a dialog box that flashes to let you know that your save to central has completed, so that if you start doing other things whilst large projects are synchronizing, you will know when it’s done. &lt;br /&gt;
I thought this was a good idea, and made a mental note to make an add-in for it, and at long last, I’ve created it. You can download the add-in from &lt;a href="http://www.rodhowarth.com/Downloads/Software/RevitSaveReminderv1.0.zip" target="_blank"&gt;HERE&lt;/a&gt;&amp;nbsp;or &lt;a href="http://punchyn.com/Downloads/RevitSaveReminderv1.0.zip"&gt;HERE&lt;/a&gt;. If you are interested in the very basic source code, &lt;a href="https://github.com/RodH257/RevitSaveReminder" target="_blank"&gt;it’s on GitHub HERE&lt;/a&gt;. &lt;br /&gt;
To install it, simply extract the files into C:\Program Files\RevitSaveReminder\ and then move the RevitSaveReminder-Manifest.addin file to your addins directory which is C:\ProgramData\Autodesk\Revit\Addins\2011\ if you are on Vista/7 or C:\Documents and Settings\All Users\Application Data\Autodesk\Revit\Addins\2011\ if you are on XP. &lt;br /&gt;
After installing it, simply open your project, when your next synchronization with central is complete, you’ll see a window like this pop up:&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TUve6XWHBdI/AAAAAAAAAFE/1hJkx5A2MP8/s1600-h/image%5B6%5D.png"&gt;&lt;img alt="image" border="0" height="166" src="http://lh3.ggpht.com/_PZEkMtbO9tU/TUve9R2q3-I/AAAAAAAAAFI/o_N8MYOyefk/image_thumb%5B2%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="394" /&gt;&lt;/a&gt;&lt;br /&gt;
And in your taskbar it’s icon will be flashing:&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_PZEkMtbO9tU/TUvfAIha0JI/AAAAAAAAAFM/Qtc7MBoACZo/s1600-h/image%5B2%5D.png"&gt;&lt;img alt="image" border="0" height="56" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TUvfI76ZCNI/AAAAAAAAAFQ/C2DnQsQdTls/image_thumb.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="182" /&gt;&lt;/a&gt;&lt;br /&gt;
Additionally, you’ll be greeted with a generous round of applause playing from your speakers, to congratulate you on successfully completing some more work. &lt;img alt="Smile" class="wlEmoticon wlEmoticon-smile" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TUvfJeSAavI/AAAAAAAAAFU/OsxRrbVTz8M/wlEmoticon-smile%5B2%5D.png?imgmax=800" style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;" /&gt; So even if you are doing some paper work on your desk, you’ll be alerted when it’s time to get back into Revit. I’ve made the sounds configurable, there’s a couple more sounds, one is a chime, and another is the cocking of a shotgun (as in, reloading and getting ready to kick Revit’s ass some more!), or if you wish, you can configure your own .wav file to play. To do this, simply edit the RevitSaveReminder.dll.config file in your program files directory. If you want no sound, edit it and make the WavFile value empty. &lt;br /&gt;
I hope someone gets some use out of this (perhaps the person that Tweeted it a couple of years ago and has no doubt been frantically searching the internet for it ever since)! Let me know your thoughts, bugs or suggestions.</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/5380886948286713572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/5380886948286713572' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/5380886948286713572'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/5380886948286713572'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/revitfree-api-addinrevit-save-reminder.html' title='[Revit]–Free API addin–Revit Save Reminder, alerts you when your save to central is complete.'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_PZEkMtbO9tU/TUve9R2q3-I/AAAAAAAAAFI/o_N8MYOyefk/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-4570310867268048682</id><published>2011-02-03T22:08:00.001+10:00</published><updated>2011-02-03T22:08:01.485+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit API]–Common Mistakes: DocumentSaved and DocumentSavedAs events</title><content type='html'>&lt;p&gt;The Revit API has many useful events, including:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;DocumentChanged&lt;/li&gt;    &lt;li&gt;DocumentSaving&lt;/li&gt;    &lt;li&gt;DocumentSavedAs&lt;/li&gt;    &lt;li&gt;DocumentClosing&lt;/li&gt;    &lt;li&gt;DocumentClosed&lt;/li&gt;    &lt;li&gt;DocumentOpened&lt;/li&gt;    &lt;li&gt;DocumentCreating&lt;/li&gt;    &lt;li&gt;DocumentCreated&lt;/li&gt;    &lt;li&gt;DocumentSynchronizingWithCentral&lt;/li&gt;    &lt;li&gt;FileExported&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And more. These let you run some code when certain events occur in Revit. You can make some powerful things with these events, so if you haven’t used them before, I recommend that you check them out. &lt;/p&gt;  &lt;p&gt;A bit of a ‘duh’ moment that you may run into, is when you want to make a tool that runs whenever the user saves the document. Seems simple enough, you subscribe to the DocumentSaved event with code similar to this:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;      &lt;span class="kwrd"&gt;public&lt;/span&gt; Result OnStartup(UIControlledApplication application)
        {
            application.ControlledApplication.DocumentSaved += ControlledApplication_DocumentSaved;
            &lt;span class="kwrd"&gt;return&lt;/span&gt; Result.Succeeded;
        }&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;However there’s a problem with this code – it won’t run the first time a user saves the document. This is because the DocumentSaved event is for when the user does a ‘Save’. If the document is new, when they click the save button, what Revit is actually doing in the background is a ‘Save As’, which prompts the user for a location and filename. &lt;/p&gt;

&lt;p&gt;So, to get that event included as well you need to do something like this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; Result OnStartup(UIControlledApplication application)
        {
            application.ControlledApplication.DocumentSaved += ControlledApplication_DocumentSaved;
            application.ControlledApplication.DocumentSavedAs += ControlledApplication_DocumentSaved;

            &lt;span class="kwrd"&gt;return&lt;/span&gt; Result.Succeeded;
        }&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This is registering the ControlledApplication_DocumentSaved method as a method to call when either of those events are called. To allow your save method to be the same method for each event, you need to set its parameters to be the following:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;void&lt;/span&gt; ControlledApplication_DocumentSaved(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, Autodesk.Revit.DB.Events.PostDocEventArgs e)
        {
          &lt;span class="rem"&gt;//my code goes here &lt;/span&gt;
        }&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Notice here that we are accepting event arguments of ‘PostDocEventArgs’ as opposed to ‘DocumentSavedAsEventArgs’ or ‘DocumentSavedEventArgs’, as PostDocEventArgs is a base class of these two. &lt;/p&gt;

&lt;p&gt;Just something to keep in mind if you plan to use Revit’s powerful events API. &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/4570310867268048682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/4570310867268048682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/4570310867268048682'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/4570310867268048682'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/revit-apicommon-mistakes-documentsaved.html' title='[Revit API]–Common Mistakes: DocumentSaved and DocumentSavedAs events'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-2782927392952543614</id><published>2011-02-02T12:10:00.002+10:00</published><updated>2011-02-13T12:33:39.675+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><title type='text'>[Revit API]–Document.PathName will be empty when unsaved or detached from central</title><content type='html'>This may seem a bit obvious but I thought I’d post it up anyway. If you are planning on relying on Document.PathName to show you where the current Revit file is located (for instance, if you are making an export tool that puts the file in the same location as the .rvt file), keep in mind that if the user has just created a new file, this value will be empty. The same also goes for Document.Title. &lt;br /&gt;
Perhaps a bit more trickier is that these values will also be empty if the user opens a central file and selects ‘detach from central’&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_PZEkMtbO9tU/TUi9F5lRaxI/AAAAAAAAAEg/JZHWAVmkrg0/s1600-h/image%5B8%5D.png"&gt;&lt;img alt="image" border="0" height="125" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TUi9GlO14WI/AAAAAAAAAEk/Ocv1dF6qUMM/image_thumb%5B4%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="596" /&gt;&lt;/a&gt;&lt;br /&gt;
If the user runs your tool before manually saving it somewhere, they will not have a PathName or Title. If your application relies on this value make sure you check it for null and have a contingency plan, such as asking the user to save the file first, or prompting them for a location. &lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TUi9G5IoQ7I/AAAAAAAAAEo/-zyg3QLsefY/s1600-h/image%5B15%5D.png"&gt;&lt;img alt="image" border="0" height="91" src="http://lh5.ggpht.com/_PZEkMtbO9tU/TUi9HpGadOI/AAAAAAAAAEs/7ZK5oVIjyfY/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="593" /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/2782927392952543614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/2782927392952543614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/2782927392952543614'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/2782927392952543614'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2011/02/revit-apidocumentpathname-will-be-empty.html' title='[Revit API]–Document.PathName will be empty when unsaved or detached from central'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_PZEkMtbO9tU/TUi9GlO14WI/AAAAAAAAAEk/Ocv1dF6qUMM/s72-c/image_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-485676096495791840</id><published>2010-11-18T10:44:00.003+10:00</published><updated>2010-11-18T10:46:17.513+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit API]–A couple more Revit API Blogs to follow</title><content type='html'>Just a quick note to let you know about a couple of blogs I’ve recently discovered that have a large amount of Revit API content. &lt;br /&gt;
First off, check out &lt;a href="http://darenatwork.blogspot.com/" target="_blank"&gt;‘Daren@Work’&lt;/a&gt; which is the blog of Daren Thomas, creator of RevitPythonShell. &lt;br /&gt;
&lt;br /&gt;
Secondly, Don Rudder has a blog ‘&lt;a href="http://revitnet.blogspot.com/" target="_blank"&gt;Revit .NET Development’&lt;/a&gt;.&amp;nbsp; Don wrote the Revit API chapter in &lt;a href="http://www.amazon.com/gp/product/0470626968?ie=UTF8&amp;amp;tag=rodhow-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=0470626968"&gt;Mastering Autodesk Revit Architecture 2011&lt;/a&gt; which I recently purchased a copy of. He is also presenting at this years AU. &lt;br /&gt;
&lt;br /&gt;
I’ve added these two sites to the index for &lt;a href="http://revitapisearch.com/" target="_blank"&gt;RevitAPISearch.com&lt;/a&gt;, so their content will be easily searchable along with the other Revit API blogs and forums that I’ve got listed there. &lt;br /&gt;
&lt;br /&gt;
If anyone else is writing a Revit API blog and would like to be included in the links on the right hand side of this page, and in the Revit API Search engine, please let me know.</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/485676096495791840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/485676096495791840' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/485676096495791840'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/485676096495791840'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2010/11/revit-apia-couple-more-revit-api-blogs.html' title='[Revit API]–A couple more Revit API Blogs to follow'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-2701485944890609230</id><published>2010-09-01T23:00:00.001+10:00</published><updated>2010-09-01T23:00:37.298+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AU2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit API] Autodesk University 2010–Introduction to the Revit API</title><content type='html'>&lt;p&gt;The &lt;a href="http://au.autodesk.com/" target="_blank"&gt;Autodesk University&lt;/a&gt; class listings for both physical and virtual classes are now available on the &lt;a href="http://au.autodesk.com/" target="_blank"&gt;AU website.&lt;/a&gt; Head over there and take a look, there are lots of great looking classes. &lt;a href="http://au.typepad.com/au/2010/08/au-2010-class-catalog-preview-in-an-excel-spreadsheet.html" target="_blank"&gt;It is also available in a handy spread sheet format&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This year they have tried to mix things up by changing the class selection a little bit, instead of having the same speakers present the same classes (even though they have been doing a great job of it) they have decided to try and get some fresh new content. Whilst new content is great, there are some classic ‘must have’ classes, and for those they have tried wherever they can to give a new speaker a chance to present on those to get a different perspective. &lt;/p&gt;  &lt;p&gt;One such ‘must have’ class is the ‘Introduction to the Revit API’ class, which as a part of the changeup, I have the privilege of presenting. I have a high standard to live up to, as in &lt;a href="http://au.autodesk.com/?nd=class&amp;amp;session_id=5230" target="_blank"&gt;previous years&lt;/a&gt; &lt;a href="http://au.autodesk.com/?nd=my_profile&amp;amp;account_id=105388" target="_blank"&gt;Danny Polkinhorn&lt;/a&gt; has done a stellar job of presenting this class, and helping many people to take their first steps in Revit API development (including me!). &lt;/p&gt;  &lt;p&gt;&lt;img src="http://au.autodesk.com/ama/orig/au2010/ebadges/AU10_speaker_225_205.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;The class description is this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;From Hello World and beyond, this class will take you through the steps of creating a Revit add-in from scratch and registering it to run inside Revit using the Revit application programming interface. You will learn how to get input from the user, access their currently selected elements, and read and write to and from the project database. Learn how the RevitLookup tool can help you to get familiar with the Revit file structure and debug your application, and learn how filters can help you speed up your database searches. With a little Microsoft® .NET programming knowledge, you can create great add-ins for Revit. This class shows you the basics that you can then build on. Some .NET programming (C# or Visual Basic®) experience is recommended.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It is a 60 minute lecture, on the first day of AU in November. &lt;/p&gt;  &lt;p&gt;I would love to hear from anyone who is attending this class as to anything they would like to see included that isn’t listed in the description above, its not a huge timeslot so I won’t be going into great detail (there is a great range of Revit API classes this year that will cover more in depth topics), but I would like to hear from people who have maybe just started learning the API as to what certain things you found difficult or what gotchas you had so I can make sure I touch on those. &lt;/p&gt;  &lt;p&gt;From my talks with people locally who have been trying to learn the API the first challenge is that of learning C# (or VB.NET), as a result I have been contemplating doing a sort of ‘C# for Revit Users’ webcast/blog post series in the lead up to AU. Stay tuned for information on that. &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/2701485944890609230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/2701485944890609230' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/2701485944890609230'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/2701485944890609230'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2010/09/revit-api-autodesk-university.html' title='[Revit API] Autodesk University 2010–Introduction to the Revit API'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-3864611824499889968</id><published>2010-07-04T22:06:00.002+10:00</published><updated>2010-07-04T22:09:52.270+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='printing'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit API] Document.PrintManager returns a new instance every time</title><content type='html'>A gotcha that you may run into if you use the Print API in Revit is that the PrintManager property of a Document always returns a NEW PrintManager.&lt;br /&gt;
So if you make a change (say to the print range) of Document.PrintManager directly, it will be pointless.&lt;br /&gt;
&lt;pre class="csharpcode"&gt;Document.PrintManager.PrintRange = PrintRange.Select;
&lt;span class="rem"&gt;//then submit print&lt;/span&gt;
Document.PrintManager.SubmitPrint(view);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;br /&gt;
both will act on a NEW PrintManager each time, which isn’t what you want. What you need to do is maintain a reference to PrintManager yourself, only calling Document.PrintManager once. &lt;br /&gt;
&lt;pre class="csharpcode"&gt;PrintManager manager = Document.PrintManager;
manager.PrintRange = PrintRange.Select;
manager.SubmitPrint(view);&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;

&lt;br /&gt;
If you have a look using &lt;a href="http://reflector.red-gate.com/download.aspx?TreatAsUpdate=1" target="_blank"&gt;Red Gate’s .NET Reflector&lt;/a&gt; to disassemble that method in the RevitAPI.dll, you can see why:&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;unsafe&lt;/span&gt; PrintManager get_PrintManager()
{
    PrintManager manager;
    REVIT_MAINTAIN_STATE revit_maintain_state;
    REVIT_MAINTAIN_STATE.{ctor}(&amp;amp;revit_maintain_state);
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        manager = &lt;span class="kwrd"&gt;new&lt;/span&gt; PrintManager(&lt;span class="kwrd"&gt;this&lt;/span&gt;);
    }
    fault
    {
        ___CxxCallUnwindDtor(REVIT_MAINTAIN_STATE.{dtor}, (&lt;span class="kwrd"&gt;void&lt;/span&gt;*) &amp;amp;revit_maintain_state);
    }
    REVIT_MAINTAIN_STATE.{dtor}(&amp;amp;revit_maintain_state);
    &lt;span class="kwrd"&gt;return&lt;/span&gt; manager;
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
As convenient as only passing around the Document object is, it’s not going to work! Changes made to one instance are not likely to apply to any others.</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/3864611824499889968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/3864611824499889968' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/3864611824499889968'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/3864611824499889968'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2010/07/revit-api-documentprintmanager-returns.html' title='[Revit API] Document.PrintManager returns a new instance every time'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-6577690046352470791</id><published>2010-06-02T21:54:00.001+10:00</published><updated>2010-06-02T21:54:12.668+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>[Revit API] Dynamic Model Update in the 2011 API</title><content type='html'>&lt;p&gt;After completing the larger than normal task of converting my suite of Revit add-ins over to the new 2011 API, I’ve recently had the chance to sit down and start having a good play with the new features. &lt;/p&gt;  &lt;p&gt;One feature which I have been particularly excited about is the new Element Level Events, also known as Dynamic Model Update. Basically, this lets you attach an event to a particular type of element, and when that element is changed, your code gets called, and can do various things. This is a feature which the team has clearly put a lot of thought into, and it opens Revit up to a whole new level of automation. Page 283 of the developers guide has a good introduction to this, and the example they use is changing all new walls to a certain type. &lt;/p&gt;  &lt;p&gt;My first idea for using this tool is to solve a problem that some of the drafters at the company I work for have been complaining about, which is detail lines in Revit. When they want to insert a detail line they hit the keyboard shortcut, and select from a long list of different line styles, then draw the line. If they are doing lots of lines, they will scroll through that list many times – which is annoying. My idea was that they could tell my add-in what line style they want to insert, and then just draw detail lines without scrolling through the list each time. &lt;/p&gt;  &lt;p&gt;The process would be this:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;User runs the tool which registers an updater, and sets the line style.&lt;/li&gt;    &lt;li&gt;When a new line is entered, that updater will be triggered&lt;/li&gt;    &lt;li&gt;The updater will then convert the newly inserted line to the line style selected.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;It was actually quite easy to get this working, which is a testament to how well this API is written. &lt;/p&gt;  &lt;p&gt;First you need to create a class that implements IUpdater. Mine was called DetailLineUpdater. You then need to implement each of the members of that interface. These include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Execute(UpdaterData data) – this is the actual method thats called when the updater is triggered, here is where I would change my line style. &lt;/li&gt;    &lt;li&gt;GetAdditionalInformation() – just returns a description&lt;/li&gt;    &lt;li&gt;GetChangePriority() – tells Revit the nature of what you will be doing in the Execute method. Revit uses this to determine in which order it should run each of the updaters. &lt;/li&gt;    &lt;li&gt;GetUpdaterId() – returns an ID for the updater, which includes the AddInId and a GUID&lt;/li&gt;    &lt;li&gt;GetUpdaterName() – a name for your updater. Make this something meaningful as it may get displayed to the user. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;As you can see, these have some similarities to the kinds of things you need to tell Revit about your external commands. &lt;/p&gt;  &lt;p&gt;Once you have your updater class, you need to do two things:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Register it, using the UpdaterRegistry.RegisterUpdater(updater) method.&lt;/li&gt;    &lt;li&gt;Tell Revit when to trigger it.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;For the second point, you need to use the UpdaterRegistry.AddTrigger method, which accepts three parameters.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The id of the Updater&lt;/li&gt;    &lt;li&gt;A filter, which tells Revit which elements to attach to.&lt;/li&gt;    &lt;li&gt;A change type. This defines what actions on the filtered elements will trigger your updater. This could be insertion, deletion, parameter changes or geometry changes. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;For my tool, I got the change type by using Element.GetChangeTypeElementAddition(). &lt;/p&gt;  &lt;p&gt;So now I have some code that will be run, whenever a certain type of element (in my case, elements with the category OST_Lines) is added. Here is a snapshot of the registration code:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;DetailLineUpdater updater = &lt;span class="kwrd"&gt;new&lt;/span&gt; DetailLineUpdater(commandData.Application.ActiveAddInId);
                UpdaterRegistry.RegisterUpdater(updater);
                ElementCategoryFilter filter = &lt;span class="kwrd"&gt;new&lt;/span&gt; ElementCategoryFilter(BuiltInCategory.OST_Lines);
                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter,Element.GetChangeTypeElementAddition());&lt;/pre&gt;

&lt;p&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;Most of the IUpdater methods are trivial, but here is my Execute method:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Execute(UpdaterData data)
        {
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (ElementId addedElement &lt;span class="kwrd"&gt;in&lt;/span&gt; data.GetAddedElementIds())
            {
                DetailLine line = data.GetDocument().get_Element(addedElement) &lt;span class="kwrd"&gt;as&lt;/span&gt; DetailLine;

                &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (Element style &lt;span class="kwrd"&gt;in&lt;/span&gt; line.LineStyles)
                {
                    &lt;span class="kwrd"&gt;if&lt;/span&gt; (style.Name.Equals(&lt;span class="str"&gt;&amp;quot;A_Certain_line_style&amp;quot;&lt;/span&gt;))
                        line.LineStyle = style;

                }
            }
            
        }&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;As you can see, its all fairly simple, and works well! However, there is a catch. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="5"&gt;Once you use an updater on a model, it permanently stains it.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What do I mean by stain? It leaves a mark. Its not a huge deal, and doesn’t affect the model, but from a software developers point of view, its not ideal. If you run a tool, such as my line styling tool, and then someone else opens your model, or even links it into their project, they get a warning saying “the file … was modified by the third-party updater …… which is not currently installed”.&lt;/p&gt;

&lt;p&gt;If you continue to edit the file, data maintained by …. will not be updated properly. This may create problems when … is later opened when …. is present. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_PZEkMtbO9tU/TAZGX3SuoAI/AAAAAAAAAA0/-dAkcFGnw9Y/s1600-h/wallwarning%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wallwarning" border="0" alt="wallwarning" src="http://lh4.ggpht.com/_PZEkMtbO9tU/TAZGY_camvI/AAAAAAAAAA8/qomLtojvEFo/wallwarning_thumb%5B2%5D.png?imgmax=800" width="460" height="350" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The user can easily just click the second option ‘Do not warn about this updater again and continue working with the file’. But I believe every user will have to do this (have not confirmed this though, would love to hear if this is not the case), and I’d imagine, if you send your model to other firms to link in, they will all get it. This is not a good user experience, and would scare or confuse some users. &lt;/p&gt;

&lt;p&gt;The intentions behind the warning are good, the Revit team obviously doesn’t want problems seen in AutoCAD where third party add-ins are so intertwined with projects that they cause a troubleshooting nightmare. But for simple time saving add-ins like my line styling tool, this is inconvenient. I’d love for there to be an option where developers can say that honestly if the updater is removed it will not cause any problems, and then that error will not show, hopefully next release! &lt;/p&gt;

&lt;p&gt;All in all, this addition is great, and makes a range of great new add-ins to be made, but when your tool is not installed, users get this dialog, which could be confusing. If this doesn’t affect you, then I encourage you to get in there and have a play around, its easier than you’d think it would be, and I’m sure you’ll come up with some great ideas of how you could utilize it. &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/6577690046352470791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/6577690046352470791' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/6577690046352470791'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/6577690046352470791'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2010/06/revit-api-dynamic-model-update-in-2011.html' title='[Revit API] Dynamic Model Update in the 2011 API'/><author><name>Rod Howarth</name><uri>https://www.blogger.com/profile/07098343984635127435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_PZEkMtbO9tU/TAZGY_camvI/AAAAAAAAAA8/qomLtojvEFo/s72-c/wallwarning_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-1054507431841499324</id><published>2009-04-27T14:09:00.001+10:00</published><updated>2009-04-27T14:09:53.101+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>Revit: 2010 API Developer Guide</title><content type='html'>&lt;p&gt;I stumbled across this document today whilst &lt;a href="http://thebuildingcoder.typepad.com/blog/2009/04/installing-the-revit-2010-sdk.html"&gt;setting up my SDK Samples menus in Revit&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;It’s located in the Revit 2010 SDK folder (there’s an extractable on the Revit disc to get this folder) and spotted the &lt;em&gt;‘Revit 2010 API Developer Guide’&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;It’s a 315 page PDF with a whole heap of tutorials, code samples and tips for using the Revit API. It’s pretty much the user manual and seems to be exactly where a new Revit API user should start. This document is exactly what I dreamed of when I started developing with the Revit API a couple of years ago!&lt;/p&gt;  &lt;p&gt;The section headings include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Getting Started&lt;/li&gt;    &lt;li&gt;Add-in Integration&lt;/li&gt;    &lt;li&gt;Application and Document&lt;/li&gt;    &lt;li&gt;Elements Essentials&lt;/li&gt;    &lt;li&gt;Parameters&lt;/li&gt;    &lt;li&gt;Collections&lt;/li&gt;    &lt;li&gt;Editing Elements&lt;/li&gt;    &lt;li&gt;Walls, Floors, Roofs and Openings&lt;/li&gt;    &lt;li&gt;Family Instances&lt;/li&gt;    &lt;li&gt;Family Creation&lt;/li&gt;    &lt;li&gt;Datum and Information Elements&lt;/li&gt;    &lt;li&gt;Annotation Elements&lt;/li&gt;    &lt;li&gt;Sketching&lt;/li&gt;    &lt;li&gt;Views&lt;/li&gt;    &lt;li&gt;Material&lt;/li&gt;    &lt;li&gt;Geometry&lt;/li&gt;    &lt;li&gt;Place and Locations&lt;/li&gt;    &lt;li&gt;Shared Parameters&lt;/li&gt;    &lt;li&gt;Transactions&lt;/li&gt;    &lt;li&gt;Events&lt;/li&gt;    &lt;li&gt;Revit Architecture&lt;/li&gt;    &lt;li&gt;Revit Structure&lt;/li&gt;    &lt;li&gt;Revit MEP&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If there isn’t anything there that interests you, you obviously aren’t interested in the Revit API. Props to Autodesk for putting this together!&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/1054507431841499324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/1054507431841499324' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/1054507431841499324'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/1054507431841499324'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2009/04/revit-2010-api-developer-guide.html' title='Revit: 2010 API Developer Guide'/><author><name>Rod</name><uri>https://www.blogger.com/profile/15899139042547529668</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-5380934530794133789</id><published>2009-03-23T17:08:00.002+10:00</published><updated>2009-03-23T17:12:12.374+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='printing'/><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>Revit: How to print sheets in order.</title><content type='html'>&lt;p&gt;I’ve had a bit of fun lately working with the Revit 2009/2010 API for printing views. There is a useful SDK sample, ‘ViewPrinter’ which shows you how to replicate the print menu in revit, but using the API.&lt;/p&gt;  &lt;p&gt;I’ve created a customized version of this that links in with our companies document management systems, and does things like prints, renames, and copies PDFs to the correct directory all with the press of a button. &lt;/p&gt;  &lt;p&gt;This has been working well for our drafters, and has sped things up, however there have been a few issues that I’ve run into whilst following the methods set out in ViewPrinter and in the SDK documentation. Most of them relate to selecting certain views (in this case, sheets) and printing them in the correct order, and with the correct amount of copies. &lt;/p&gt;  &lt;p&gt;The way the SDK sample does this, is it gathers a list of the sheet names the user selected, compares their names with those in the PrintMan.ViewSheetSetting.AvailableViews list and selects ones that match. It then adds these into a ViewSet, and supplies that to PrintMan and calls SubmitPrint().&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;   &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;//create Viewset store those you need to print&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; ViewSet viewsToPrint = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ViewSet();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;//Compare your list of sheets, to those in AvailableViews&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; selectedSheetNames) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (View view &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; _printMan.ViewSheetSetting.AvailableViews)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;      {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (view.ViewType == ViewType.DrawingSheet)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;             &lt;span style="color: #008000"&gt;//cast to viewsheet&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;             ViewSheet vs = view &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; ViewSheet;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (vs != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; name.Contains(vs.SheetNumber + &lt;span style="color: #006080"&gt;&amp;quot; - &amp;quot;&lt;/span&gt; + vs.Name))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;                 viewsToPrint.Insert(vs);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum17" style="color: #606060"&gt;  17:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum18" style="color: #606060"&gt;  18:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum19" style="color: #606060"&gt;  19:&lt;/span&gt;      }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum20" style="color: #606060"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum21" style="color: #606060"&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum22" style="color: #606060"&gt;  22:&lt;/span&gt; ViewSheetSet viewSheetSet = m_viewSheetSetting.CurrentViewSheetSet;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum23" style="color: #606060"&gt;  23:&lt;/span&gt; viewSheetSet.Views = selectedViews;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum24" style="color: #606060"&gt;  24:&lt;/span&gt; m_viewSheetSetting.Save();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum25" style="color: #606060"&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum26" style="color: #606060"&gt;  26:&lt;/span&gt; &lt;span style="color: #008000"&gt;//set copies&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum27" style="color: #606060"&gt;  27:&lt;/span&gt; _printMan.CopyNumber = numCopies;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum28" style="color: #606060"&gt;  28:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum29" style="color: #606060"&gt;  29:&lt;/span&gt; &lt;span style="color: #008000"&gt;//submit print&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum30" style="color: #606060"&gt;  30:&lt;/span&gt; _printMan.SubmitPrint(v); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum31" style="color: #606060"&gt;  31:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum32" style="color: #606060"&gt;  32:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This works great ok normally, however there is a significant problem. The problem lies in how the views are stored. The views are placed into a ViewSet, which is an implementation of the Set collection type, ie, an &lt;strong&gt;unordered&lt;/strong&gt; set of items. Unfortunately, this means that us coders have no say in how the prints get ordered. &lt;/p&gt;

&lt;p&gt;My experimentation shows that revit seems to order them by ElementID, or, in the order they were created. So lets say you create Sheet 1, Sheet 2, Sheet 4, Sheet 3, in that order. That is exactly how they will come out of the printer, even though the user would assume otherwise. &lt;/p&gt;

&lt;p&gt;My workaround for this, after much trial and error, is this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;
  &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum1" style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;//create a list of view tp store those you need to print&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum2" style="color: #606060"&gt;   2:&lt;/span&gt; List&amp;lt;View&amp;gt; viewsToPrint = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;View&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum3" style="color: #606060"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum4" style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;//Compare your list of sheets, to those in AvailableViews&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum5" style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; selectedSheetNames) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum6" style="color: #606060"&gt;   6:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum7" style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (View view &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; _printMan.ViewSheetSetting.AvailableViews)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum8" style="color: #606060"&gt;   8:&lt;/span&gt;      {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum9" style="color: #606060"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (view.ViewType == ViewType.DrawingSheet)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum10" style="color: #606060"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum11" style="color: #606060"&gt;  11:&lt;/span&gt;             &lt;span style="color: #008000"&gt;//cast to viewsheet&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum12" style="color: #606060"&gt;  12:&lt;/span&gt;             ViewSheet vs = view &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; ViewSheet;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum13" style="color: #606060"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum14" style="color: #606060"&gt;  14:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (vs != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; name.Contains(vs.SheetNumber + &lt;span style="color: #006080"&gt;&amp;quot; - &amp;quot;&lt;/span&gt; + vs.Name))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum15" style="color: #606060"&gt;  15:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum16" style="color: #606060"&gt;  16:&lt;/span&gt;                 viewsToPrint.Add(vs);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum17" style="color: #606060"&gt;  17:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum18" style="color: #606060"&gt;  18:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum19" style="color: #606060"&gt;  19:&lt;/span&gt;      }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum20" style="color: #606060"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum21" style="color: #606060"&gt;  21:&lt;/span&gt; &lt;span style="color: #008000"&gt;//loop through copies &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum22" style="color: #606060"&gt;  22:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 1; i &amp;lt;= numCopies; i++) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum23" style="color: #606060"&gt;  23:&lt;/span&gt; { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum24" style="color: #606060"&gt;  24:&lt;/span&gt;  &lt;span style="color: #008000"&gt;//loop through each view &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum25" style="color: #606060"&gt;  25:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (View v &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; viewsToPrint) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum26" style="color: #606060"&gt;  26:&lt;/span&gt;  { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum27" style="color: #606060"&gt;  27:&lt;/span&gt;   &lt;span style="color: #008000"&gt;//submit print of just 1 view &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum28" style="color: #606060"&gt;  28:&lt;/span&gt;    _printMan.SubmitPrint(v); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum29" style="color: #606060"&gt;  29:&lt;/span&gt;   } &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span id="lnum30" style="color: #606060"&gt;  30:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;There are a number of steps behind the scenes (such as setting up _printMan aka my PrintManager to have the correct settings) but instead of supplying PrintManager with a ViewSet of views I want to print, and changing the CopyNumber to how many times I wish to print them, I’m printing one view at a time using the overload for SubmitPrint. This allows me to order my list of selectedSheetNames in the way I wish it to come out, including sorting and reversing it. I’ve also done a for loop to replicate the CopyNumber property.&lt;/p&gt;

&lt;p&gt;Now, at long last, my prints are coming out in the correct order! &lt;/p&gt;

&lt;p&gt;Note: This code was created for Revit 2010, not fully tested in 2009, though most of it should work the same.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/5380934530794133789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/5380934530794133789' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/5380934530794133789'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/5380934530794133789'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2009/03/revit-how-to-print-sheets-in-order.html' title='Revit: How to print sheets in order.'/><author><name>Rod</name><uri>https://www.blogger.com/profile/15899139042547529668</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-3538516406346640312</id><published>2009-03-11T14:06:00.006+10:00</published><updated>2009-03-11T14:23:37.261+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='2010'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>Revit 2010 - More feedback on external commands errors</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;While Matt Mason has been blogging away furiously at the Revit 2010 platform/API enhancements, I've got a smaller feature to talk about.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;If you're anything like me, you would have run into the situation where you create an external command, link it up in the ini file, and go to run it.. and get nothing, no error, no warnings, just nothing. While the journal file can sometimes offer a little bit of assistance, you really have very little to go on. &lt;/div&gt;
&lt;div&gt;This has changed in 2010, with increased reporting of errors in API commands. One I noticed today is that if you link to a DLL file in the revit.ini that doesn't exist, you will get a popup warning alerting you that your dll doesn't exist and thus the command has been disabled. This is great, as often typos are made in the revit.ini, and this points you straight to it. &lt;/div&gt;
&lt;img id="BLOGGER_PHOTO_ID_5311780470710917330" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 88px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYYVYKpLzcq4wpKbUyW6WqODbnj7Hw9TaSoSdE19SBG8fRgZVfgQ-gisbbHnYpg-ahk2xxgBT0hYgkZBrJ70Py0ig887m7JcDkGqd6Msthe4DI-II4wx64kP5sgvIn1By-gtM81PMSR1F6/s320/FIleNotFound.png" border="0" /&gt;  &lt;div&gt;Another one is that when an unhandled exception occurs, a friendlier dialog box is now shown, alerting the user to the error, and allows them to view technical detail if they wish. Previously it was a standard .net dialog box which didn't mean much to the end user. &lt;/div&gt;
&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5311780795942735170" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 82px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoO8peMAqtGa2mFIQN7gJ_ghB8nYMXd3QBaVl2bVUhDKJMWCQ62w24TuCu_XjmjjESv-BcKfjBtJAJfTv3-tFyDFIa3UfbtkUcLVerMivBXBaAMEf9wx4TVwMf6_g-99cqAhlDAO8yANAa/s320/excmmanderror1.png" border="0" /&gt;
&lt;img id="BLOGGER_PHOTO_ID_5311780801289535330" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 158px; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtOEEXwUh5BLYgELnqIp2ZhEvBLPvffB_Ile-hyV62k0IGgyRkWxzBwGgEOOaL8DxmZZi6x1h5PKEf41mYF9W9hPAxVaYeewamGPgXy1N7dnueGvbuKNRDXevhs5kLq9tOEGeUozjWWfOu/s320/excommanderror2.png" border="0" /&gt; &lt;div&gt;It's the little things that count, and this little thing is a worthy inclusion in Revit 2010!&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/3538516406346640312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/3538516406346640312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/3538516406346640312'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/3538516406346640312'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2009/03/revit-2010-more-feedback-on-external.html' title='Revit 2010 - More feedback on external commands errors'/><author><name>Rod</name><uri>https://www.blogger.com/profile/15899139042547529668</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYYVYKpLzcq4wpKbUyW6WqODbnj7Hw9TaSoSdE19SBG8fRgZVfgQ-gisbbHnYpg-ahk2xxgBT0hYgkZBrJ70Py0ig887m7JcDkGqd6Msthe4DI-II4wx64kP5sgvIn1By-gtM81PMSR1F6/s72-c/FIleNotFound.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5096437112654914738.post-2889407817927525532</id><published>2009-02-23T15:59:00.002+10:00</published><updated>2009-02-23T16:03:39.191+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Revit'/><category scheme='http://www.blogger.com/atom/ns#' term='Parameters'/><category scheme='http://www.blogger.com/atom/ns#' term='API'/><title type='text'>Parameter.Set - Unexpected Behaviour</title><content type='html'>This is something I ran into today working on a Revit API External Command.

The program I was trying to make, involves changing the 'Mark' parameter on beams/columns. I was using the Parameter.Set(string) boolean, which returns true if the parameter was set successfully to the new value, otherwise false.

I decided to use the T/F value to determine if it had been successful or not, before incrementing a certain value. It turns out however, that the Set method only returns True if it has been set to a &lt;strong&gt;new&lt;/strong&gt; value. So if you assign the same value that was already in the mark, it returns false! So my program was thinking that the method had failed, when really, it just had set the same value as was already there.

So keep in mind that if you are going to use the T/F value of this method, make sure you also compare the value which you are setting, with the current value of the parameter.</content><link rel='replies' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/2889407817927525532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment/fullpage/post/5096437112654914738/2889407817927525532' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5096437112654914738/posts/default/2889407817927525532'/><link rel='self' type='application/atom+xml' href='http://blog.rodhowarth.com/feeds/posts/default/2889407817927525532'/><link rel='alternate' type='text/html' href='http://blog.rodhowarth.com/2009/02/parameterset-unexpected-behaviour.html' title='Parameter.Set - Unexpected Behaviour'/><author><name>Rod</name><uri>https://www.blogger.com/profile/15899139042547529668</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='35' height='35' src='//www.blogger.com/img/blogger_logo_round_35.png'/></author><thr:total>0</thr:total></entry></feed>