tag:blogger.com,1999:blog-325777272024-03-07T18:45:55.946-08:00Revit CoasterThe ups and downs of Revit.Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-32577727.post-63651702906924985522017-05-19T14:45:00.000-07:002017-05-19T14:45:20.502-07:00Autodesk University 2017 Class ProposalsThis year Autodesk University is allowing people to vote on the classes that they would like to see offered at the upcoming AU2017 in November. I have submitted two (2) classes for people to vote on. If you would like to see these classes, please take a couple minutes and vote for them...<br />
<br />
Website: <a href="http://au.autodesk.com/speaker-resource-center/call-for-proposals/voting">http://au.autodesk.com/speaker-resource-center/call-for-proposals/voting</a><br />
<br />
To find my classes use the following (or search by name):<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsVbCH5z4SpT_wgwXRcX3O4iY49VZwXocNUK1XxLs2Or-xb7FMrT4Ve5tddaAgpLLZmQX8PktC04aPEtDt4_fJQxihIvDBCvrx8RUJSLts0A53ZIEn6veIC6LJ9k4DOcG14qQt/s1600/AU2017_01.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsVbCH5z4SpT_wgwXRcX3O4iY49VZwXocNUK1XxLs2Or-xb7FMrT4Ve5tddaAgpLLZmQX8PktC04aPEtDt4_fJQxihIvDBCvrx8RUJSLts0A53ZIEn6veIC6LJ9k4DOcG14qQt/s640/AU2017_01.png" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjinEjZ-p0ZKzmTqVIkD7z9tAJnZiSacCJelfTEWZIrTufCF0H_nGtIXV4GrP-xGLjM-LeOMyX2hMAK3Jdc78FAMtuUKYYHoGSAZtRH567brb4f0aT4MMeFEn9hrTfmZPGsMBPp/s1600/AU2017_02.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="311" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjinEjZ-p0ZKzmTqVIkD7z9tAJnZiSacCJelfTEWZIrTufCF0H_nGtIXV4GrP-xGLjM-LeOMyX2hMAK3Jdc78FAMtuUKYYHoGSAZtRH567brb4f0aT4MMeFEn9hrTfmZPGsMBPp/s640/AU2017_02.png" width="640" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFNxxUDNdsCsHhu-aXQ0Ksj_TbzgipInwZ12kPAO6r70NBGdZYOYABUxlFvdyrQL1V8n3EQMxfpQSKNnfRo13J_GioklBtG_yuWLQTw8Fvdf9rcuNYqdv4gknQqJSCuCZFDWf9/s1600/AU2017_03.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFNxxUDNdsCsHhu-aXQ0Ksj_TbzgipInwZ12kPAO6r70NBGdZYOYABUxlFvdyrQL1V8n3EQMxfpQSKNnfRo13J_GioklBtG_yuWLQTw8Fvdf9rcuNYqdv4gknQqJSCuCZFDWf9/s640/AU2017_03.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0tag:blogger.com,1999:blog-32577727.post-80539981071835514652017-04-21T13:53:00.000-07:002017-04-21T13:56:08.491-07:00Revit Lookup 2018Continuing with the tradition of compiling the awesome opensource Revit addin "Revit Lookup", I have taken the Revit 2018 version and compiled it for those that do not know or want to try compiling the source code for themselves.<br />
<br />
<span style="font-size: large;">Download Revit Lookup 2018 <a href="https://app.box.com/s/xhsc1xswatyy0a28jmid25qi5v9noocy" target="_blank">here</a>.</span><br />
<br />
<i>I have added a link on the right side of the blog and will keep it updated whenever there is a new build available.</i><br />
<br />
<br />
<span style="font-size: large;">Revit Lookup (<a href="https://github.com/jeremytammik/RevitLookup" target="_blank">https://github.com/jeremytammik/RevitLookup</a>)</span><br />
Interactive Revit BIM database exploration tool to view and navigate element properties and relationships.<br />
<br />
Please refer to <a href="http://thebuildingcoder.typepad.com/" target="_blank">The Building Coder</a> for more information.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirPoKqDio8CXQN34Fsip4NaKixufQdK5nBWsYSkHOS5XbKUKRb8FtjaRIlPIbaijzfLl9g5jjb2xfbOWhmInaBhKGlBmOOX_5PP9gzrwl-_5jY798QWyjdmiPzxDuNFsxApd_G/s1600/RevitLookup1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirPoKqDio8CXQN34Fsip4NaKixufQdK5nBWsYSkHOS5XbKUKRb8FtjaRIlPIbaijzfLl9g5jjb2xfbOWhmInaBhKGlBmOOX_5PP9gzrwl-_5jY798QWyjdmiPzxDuNFsxApd_G/s1600/RevitLookup1.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4DDLs9BQUgIcOWHG045RdnLQWb7At2CJTAmOcrLWz_mD2iaF4sNqF_yh8ovbUvbhN06ZXgUUnU17tTYHiW1wsXVZOvAsrEmccx_12fyUsHg3-UdxuOY0FiXvV4dR44U0T9qAG/s1600/RevitLookup2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4DDLs9BQUgIcOWHG045RdnLQWb7At2CJTAmOcrLWz_mD2iaF4sNqF_yh8ovbUvbhN06ZXgUUnU17tTYHiW1wsXVZOvAsrEmccx_12fyUsHg3-UdxuOY0FiXvV4dR44U0T9qAG/s640/RevitLookup2.png" width="640" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0tag:blogger.com,1999:blog-32577727.post-87028702616938490482017-04-13T07:47:00.000-07:002017-04-13T07:47:49.929-07:00Revit 2018 Export Warnings from Model to Excel<b>Revit 2018 </b>has added a great new addition to the API that allows you to collect all of the <b>Warnings</b> that exist in the model. Previously, you could only export this list by using the builtin "Export" button in the Warnings dialog, that exported to a HTML file.<br />
<br />
The new addition is the following:
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="font-size: large;">IList<FailureMessage> warnings = doc.GetWarnings();</span>
</pre>
</div>
<br />
The following macro will export all the warnings in your model to Excel:
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> ExportWarningsToExcel()
{
<span style="color: green;">// make sure to add a reference to Excel Object Library</span>
<span style="color: green;">// put the following (minus the // into your using statements)</span>
<span style="color: green;">// using xls = Microsoft.Office.Interop.Excel;</span>
<span style="color: green;">// using System.Reflection;</span>
<span style="color: green;">// create a new Excel connection</span>
xls.Application xlApp = <span style="color: blue;">new</span> xls.Application();
<span style="color: green;">// make sure you have access to Excel</span>
<span style="color: blue;">if</span> (<span style="color: blue;">null</span> == xlApp)
{
TaskDialog.Show(<span style="color: #a31515;">"Error"</span>, <span style="color: #a31515;">"Failed to start or access Excel"</span>);
<span style="color: blue;">return</span>;
}
<span style="color: green;">// get the current model</span>
Document doc = <span style="color: blue;">this</span>.ActiveUIDocument.Document;
<span style="color: green;">// get a list of all the model's warnings</span>
IList<FailureMessage> warnings = doc.GetWarnings();
<span style="color: blue;">try</span>
{
<span style="color: green;">// show the Excel window</span>
xlApp.Visible = <span style="color: blue;">true</span>;
<span style="color: green;">// create a new Workbook in Excel</span>
xls.Workbook workbook = xlApp.Workbooks.Add(Missing.Value);
<span style="color: green;">// create a new Worksheet in Excel</span>
xls.Worksheet worksheet = (xls.Worksheet)workbook.Worksheets.Item[1];
<span style="color: green;">// name the Worksheet with the model name</span>
worksheet.Name = doc.Title;
<span style="color: green;">// create a header row</span>
worksheet.Cells[1,1] = <span style="color: #a31515;">"Warning Description"</span>;
worksheet.Cells[1,2] = <span style="color: #a31515;">"Elements"</span>;
<span style="color: green;">// count the number of warnings</span>
<span style="color: #2b91af;">int</span> numWarnings = 0;
<span style="color: green;">// start on row 2 for warnings</span>
<span style="color: #2b91af;">int</span> row = 2;
<span style="color: green;">// loop through each warning</span>
<span style="color: blue;">foreach</span> (FailureMessage fmsg <span style="color: blue;">in</span> warnings)
{
<span style="color: green;">// add the warning desciption to cell in Excel</span>
worksheet.Cells[row, 1] = fmsg.GetDescriptionText();
<span style="color: green;">// create a string to hold element info</span>
<span style="color: #2b91af;">string</span> elements = <span style="color: #a31515;">""</span>;
<span style="color: green;">// loop through the element ids</span>
<span style="color: blue;">foreach</span> (ElementId eid <span style="color: blue;">in</span> fmsg.GetFailingElements())
{
<span style="color: green;">// get the element</span>
Element e = doc.GetElement(eid);
<span style="color: green;">// add the element category</span>
elements += e.Category.Name + <span style="color: #a31515;">" : "</span>;
<span style="color: green;">// some elements fail when getting their family type, so skip getting type if it fails</span>
<span style="color: blue;">try</span>
{
<span style="color: green;">// get the element family type</span>
elements += e.LookupParameter(<span style="color: #a31515;">"Family"</span>).AsValueString() + <span style="color: #a31515;">" : "</span>;
}
<span style="color: blue;">catch</span>
{
}
<span style="color: green;">// add the element name</span>
elements += e.Name + <span style="color: #a31515;">" : "</span>;
<span style="color: green;">// add the element id</span>
elements += <span style="color: #a31515;">"id "</span> + eid.ToString() + System.Environment.NewLine + System.Environment.NewLine;
}
<span style="color: green;">// add elements to cell in Excel</span>
worksheet.Cells[row, 2] = elements;
<span style="color: green;">// go to next row to Excel</span>
++row;
<span style="color: green;">// increment number of warnings</span>
numWarnings++;
}
<span style="color: green;">// expand columns to fit text</span>
xls.Range col1 = worksheet.get_Range(<span style="color: #a31515;">"A1"</span>, Missing.Value);
xls.Range col2 = worksheet.get_Range(<span style="color: #a31515;">"B1"</span>, Missing.Value);
col1.EntireColumn.ColumnWidth = 70;
col1.EntireColumn.WrapText = <span style="color: blue;">true</span>;
col2.EntireColumn.ColumnWidth = 25;
<span style="color: green;">// show dialog for results</span>
TaskDialog.Show(<span style="color: #a31515;">"Success"</span>, <span style="color: #a31515;">"Exported "</span> + numWarnings.ToString() + <span style="color: #a31515;">" warnings to Excel!!!"</span>);
}
<span style="color: blue;">catch</span> (Exception ex)
{
TaskDialog.Show(<span style="color: #a31515;">"Error"</span>, <span style="color: #a31515;">"Something bad happened!!!"</span> + System.Environment.NewLine
+ System.Environment.NewLine + ex.Message);
}
}
</pre>
</div>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com1tag:blogger.com,1999:blog-32577727.post-14787403118885933002017-02-24T12:22:00.001-08:002017-02-24T12:26:12.851-08:00Export All Possible Revit WarningsA few weeks ago, <a href="https://twitter.com/arch_laboratory" target="_blank">Konrad Sobon</a>, posted a Python script for <a href="http://archi-lab.net/digging-through-revit-warnings-to-find-meaning/" target="_blank">exporting all the possible Revit warnings</a> to use in a Dynamo script that analyzes and ranks the warnings in the current model. Since I mostly work in C#, I took his Python script and created a C# macro. I've had several requests for it, so here it is...<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> ExportWarnings()
{
<span style="color: blue;">try</span>
{
<span style="color: blue;">using</span> (StreamWriter writer = <span style="color: blue;">new</span> StreamWriter(<span style="color: #a31515;">@"C:\temp\warnings.txt"</span>))
{
FailureDefinitionRegistry failures = Autodesk.Revit.ApplicationServices.Application.GetFailureDefinitionRegistry();
IList<FailureDefinitionAccessor> failuresList = failures.ListAllFailureDefinitions();
<span style="color: blue;">foreach</span> (FailureDefinitionAccessor failure <span style="color: blue;">in</span> failuresList)
{
<span style="color: blue;">if</span> (failure.GetSeverity() == FailureSeverity.Warning)
writer.WriteLine(failure.GetDescriptionText());
}
writer.Close();
}
}
<span style="color: blue;">catch</span>
{
}
}
</pre>
</div>
<br />
<br />
And the resulting file from Revit 2017 : <a href="https://app.box.com/s/1a1zig324s9zxp9o6izqru1dum1gtm26" target="_blank">Warnings.txt</a>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com3tag:blogger.com,1999:blog-32577727.post-3055310282952733602017-02-01T17:20:00.000-08:002017-02-01T17:32:27.676-08:00Adding Revisions to a Sheet IndexRecently, I had someone make a request for adding an X to a column in a sheet index schedule for all the revisions that sheet had. Currently, they have to do it by hand and it is tedious.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtGDxE7iTUt4Stnx10CuApb4P67A8TqLBZF4KE3AoygDkLpkL4rI88npVtXGtIrRCcE7nLGRYiHdKhsJcJJLGz7Ljp6mXiCsM7SLcxOtyhTmK-567F1iFSUCy7xbgpQ3vNfrQJ/s1600/SheetIndex.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtGDxE7iTUt4Stnx10CuApb4P67A8TqLBZF4KE3AoygDkLpkL4rI88npVtXGtIrRCcE7nLGRYiHdKhsJcJJLGz7Ljp6mXiCsM7SLcxOtyhTmK-567F1iFSUCy7xbgpQ3vNfrQJ/s320/SheetIndex.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
To get this to work, I added a parameter for each revision called "<b>Seq #</b>" (with # being the revision sequence number). I looped through each revision on each sheet and looked up it's sequence number, then add an X to the parameter matching it.<br />
<br />
Here is a video showing how it fills in the sheet index schedule:<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<!-- copy and paste. Modify height and width if desired. --><iframe class="tscplayer_inline embeddedObject" name="tsc_player" scrolling="no" frameborder="0" type="text/html" style="overflow:hidden;" src="https://www.screencast.com/users/TroyGates/folders/Snagit/media/c23b2667-ac64-48cc-aa5a-639b31ab75a2/embed" height="488" width="622" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
And the code...</div>
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: navy; font-weight: bold;">public</span> <span style="color: navy; font-weight: bold;">void</span> SheetRevisions()
{
Document doc = <span style="color: navy; font-weight: bold;">this</span>.ActiveUIDocument.Document;
<span style="color: navy; font-weight: bold;">using</span> (Transaction t = <span style="color: navy; font-weight: bold;">new</span> Transaction(doc, <span style="color: blue;">"Revisions on Sheet"</span>))
{
t.Start();
<span style="color: #008800; font-style: italic;">// loop through all the sheets in the model</span>
<span style="color: navy; font-weight: bold;">foreach</span> (ViewSheet vs <span style="color: navy; font-weight: bold;">in</span> <span style="color: navy; font-weight: bold;">new</span> FilteredElementCollector(doc).OfClass(<span style="color: navy; font-weight: bold;">typeof</span>(ViewSheet)))
{
<span style="color: #008800; font-style: italic;">// get a list of all the Revision Ids for this sheet</span>
IList<ElementId> revIds = vs.GetAllRevisionIds();
<span style="color: #008800; font-style: italic;">// if at least 1 Revision, continue</span>
<span style="color: navy; font-weight: bold;">if</span> (revIds.Count > <span style="color: blue;">0</span>)
{
<span style="color: #008800; font-style: italic;">// loop through each of the Revision Ids</span>
<span style="color: navy; font-weight: bold;">foreach</span> (ElementId eid <span style="color: navy; font-weight: bold;">in</span> revIds)
{
<span style="color: #008800; font-style: italic;">// get the actual Revision element</span>
Element elem = doc.GetElement(eid);
Revision rev = elem <span style="color: navy; font-weight: bold;">as</span> Revision;
<span style="color: #008800; font-style: italic;">// add an X to the parameter named "Seq #"</span>
vs.LookupParameter(<span style="color: blue;">"Seq "</span> + rev.SequenceNumber.ToString()).Set(<span style="color: blue;">"X"</span>);
}
}
}
t.Commit();
}
}
</pre>
</td></tr>
</tbody></table>
</div>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com3tag:blogger.com,1999:blog-32577727.post-49344777627172977242016-05-02T11:56:00.000-07:002016-05-02T11:56:33.617-07:00RevitLookup 2017I have compiled the latest source code for RevitLookup 2017 from Jeremy Tammik's GitHub (https://github.com/jeremytammik/RevitLookup).<br />
<br />
Note: I did not create or edit this Revit Addin. I am only compiling it for those that don't understand or want to compile it for themselves.<br />
<br />
Here is the download link: <a href="https://app.box.com/s/xuqylynvetxn3ve474cbf4t9yfijsm60" target="_blank">RevitLookup2017.zip</a><br />
<br />
It is also listed on the right-hand column under downloads.Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0tag:blogger.com,1999:blog-32577727.post-59891895018224676542016-03-16T14:52:00.004-07:002016-03-16T14:52:35.068-07:00PDQ Deploy and Inventory for Autodesk and other applications<span style="font-weight: normal;">I have been using PDQ Deploy and Inventory for about 2 years
now. It has been one of the highest ROIs on a product I have ever used. The
ease, speed, and reliability of being able to push a product, product updates,
and custom product settings out to 350+ PCs from a $1000 pair of tools has been
a game changer for my company.</span><br />
<span style="font-weight: normal;"><br /></span>
<br />
<div class="MsoNormal">
<o:p></o:p></div>
<h2>
What is PDQ?<o:p></o:p></h2>
<div class="MsoNormal">
PDQ Deploy and PDQ Inventory (by <a href="http://www.adminarsenal.com/" target="_blank">Admin Arsenal</a>) are a pair of applications that
allow BIM Mangers, IT Admins, etc to deploy software and files silently across
many PCs as well as keep an inventory of all the PCs software, hardware, and
more. The programs do not require any pre-installation of software on the PCs
and can install just about anything most companies need across a single office
or multiple offices.<br />
<o:p></o:p></div>
<div class="MsoNormal">
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2S6bM-LgfLCGypE8u_K1WapnJjKDpQaky4bq38GHnPJ1uAC4dtjwv7e-a4yutOr4TnuVZS6EIHu9-ylasXJjJ0c1_2uHhwd_YAm57CH3Kkm13qKuiceuKFMW_AOeDXMAHqr4/s1600/image+8.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="382" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY2S6bM-LgfLCGypE8u_K1WapnJjKDpQaky4bq38GHnPJ1uAC4dtjwv7e-a4yutOr4TnuVZS6EIHu9-ylasXJjJ0c1_2uHhwd_YAm57CH3Kkm13qKuiceuKFMW_AOeDXMAHqr4/s640/image+8.png" width="640" /></a><br />
<br />
<br />
<br />
<br /></div>
<h2>
<br /></h2>
<h2>
<br /></h2>
<h2>
<br /></h2>
<h2>
<br /></h2>
<h2>
<br /></h2>
<h2>
<br /></h2>
<h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYWEsTmktzTJhqrMEY4WmyUf418DB_vO4wiOW_NJhRzjDhLMWLrx0NZCO90xpoIgkmDKZf2twS9B2ENGi_8eGnLbgHqsFDvJhJYUa2Y50uJP0AvkJE7_4Rd4niEFzmj6dgAWzA/s1600/image+7.png" imageanchor="1"><img border="0" height="382" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYWEsTmktzTJhqrMEY4WmyUf418DB_vO4wiOW_NJhRzjDhLMWLrx0NZCO90xpoIgkmDKZf2twS9B2ENGi_8eGnLbgHqsFDvJhJYUa2Y50uJP0AvkJE7_4Rd4niEFzmj6dgAWzA/s640/image+7.png" width="640" /></a></h2>
<h2>
<br /></h2>
<h2>
My Setup<o:p></o:p></h2>
<div class="MsoNormal">
My company currently uses PDQ to inventory well over 400 PCs
and pushes deployments across 7 offices in 2 countries. We use PDQ inventory to
track which PCs have which versions and service packs of all software applications,
then use PDQ Deployment to automatically push updates to them. We also use PDQ
to push out new versions of applications as they become available. Lastly, we
use PDQ to deploy suites of applications to new systems within the company,
gone are the old days of having a system image with everything installed.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<h2>
PDQ Inventory<o:p></o:p></h2>
<div class="MsoNormal">
PDQ Inventory can tie into your Active Directory (AD) to
quickly learn about all of the PCs within your company. My company has PCs in
an AD container system like in the image below. By having PCs grouped based on office
and whether it is a desktop/laptop/conference room/server, allows us to only
inventory the PCs we want to use for deployments. We do not currently use PDQ
Inventory or Deploy for servers. <o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNokQ4mvdT5zNocob-i1oro_TPFV2AYHlxofNOgK5Vr0t99V_Cikb0mg3kPXRwGyYlFuS1LSLPn6X16j5qToYEcFa0cJ8F6CrWvTOFJxwoNFMal9fk9xuT7_0X9kuo0OKjMRun/s1600/image+1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNokQ4mvdT5zNocob-i1oro_TPFV2AYHlxofNOgK5Vr0t99V_Cikb0mg3kPXRwGyYlFuS1LSLPn6X16j5qToYEcFa0cJ8F6CrWvTOFJxwoNFMal9fk9xuT7_0X9kuo0OKjMRun/s1600/image+1.png" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
PDQ Inventory is used to create reports about which systems
have which software as well as the version of the software. These reports are easy to build using the built-in report creator.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div style="text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSWYS5U341UiRHAHunWh_JLE3ii4b_O_5N9S8sRh52TGjhBAe4S-Eo5HCFG02BXr8MXwkjxK6m58xsddhwhylsVp9vD92aDaxCAEp8g-dHaS3sBhgx5QOGQ34dCVoMtliy7LUX/s1600/image+2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSWYS5U341UiRHAHunWh_JLE3ii4b_O_5N9S8sRh52TGjhBAe4S-Eo5HCFG02BXr8MXwkjxK6m58xsddhwhylsVp9vD92aDaxCAEp8g-dHaS3sBhgx5QOGQ34dCVoMtliy7LUX/s1600/image+2.png" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoy8fANh6rc3n7cFi6hh5EZoygf9dwUtoRBUdvEUmvKH_I1E47ak1bQV06rjycXT9Qrf4eqkU-JqXCKhPfpa0Y9M3i3xvgWI3srEMyU3S35dCTauhbjQOR9Z4xBXbySEvIZ5PC/s1600/image+3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoy8fANh6rc3n7cFi6hh5EZoygf9dwUtoRBUdvEUmvKH_I1E47ak1bQV06rjycXT9Qrf4eqkU-JqXCKhPfpa0Y9M3i3xvgWI3srEMyU3S35dCTauhbjQOR9Z4xBXbySEvIZ5PC/s1600/image+3.png" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
PDQ Inventory also
has what are called “collections”. The collections are live reports of PCs that
meet the criteria of the collection. For instance in the next image, it shows all the
PCs that have an Autodesk product installed, then the PCs that have Revit 2016
installed, and finally the PCs in each office that have Revit 2016 installed.
These collections can be used as a source of PCs that PDQ Deployment can use to
deploy a package to.<o:p></o:p><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_tP9X1EQ-MCOIlYPb9tmFQCGee2C1ZGcC8Tka3ZpQBGYqV_PCL0pNwWV2NMUICgm3e0qt2fdx7NmX7lv0bF_0XVl56KMn_X8pu5HRPUlhx_yNpDJ7wtsIY0UHRXD1rrevU03v/s1600/image+4.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_tP9X1EQ-MCOIlYPb9tmFQCGee2C1ZGcC8Tka3ZpQBGYqV_PCL0pNwWV2NMUICgm3e0qt2fdx7NmX7lv0bF_0XVl56KMn_X8pu5HRPUlhx_yNpDJ7wtsIY0UHRXD1rrevU03v/s400/image+4.png" /></a><br />
<br />
<br />
<h2>
PDQ Deploy</h2>
PDQ Deploy allows you to create packages of applications, patches, and settings than you can then push remotely and silently to any number of PCs.<br />
<br />
Creating a package in PDQ Deploy is as easy as specifying the msi, exe, bat, etc file that you want to deploy. By combing several steps (see image) you end up with a full blown package like the image below for Revit 2016, Dynamo, several addins, ini files and updates.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikNxJAtqGRD72jYVrO-x77KXbaBulfHNXmgU9KTdB_zlR7EbqhNrKPO7-n9xyxiBF3mvMQ1kZEEnLQTrmWsfBUpAWwlR7mLK4o-CHkS9Wo_eVBScGPzp7WC86Swb8csHUAfbB5/s1600/image+6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikNxJAtqGRD72jYVrO-x77KXbaBulfHNXmgU9KTdB_zlR7EbqhNrKPO7-n9xyxiBF3mvMQ1kZEEnLQTrmWsfBUpAWwlR7mLK4o-CHkS9Wo_eVBScGPzp7WC86Swb8csHUAfbB5/s400/image+6.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnj6GMz4q-763APLxi7BYYyYDYNSIXQepkja50BApca9MnS0pZx4HmB7wooVCNodBLIpXe69Z32nSc30hIL0T5ZXCwfWn_FGOMaUkWSU_F04pvCTfSO95sLqmrpMmfU4nzxcJC/s1600/image+5.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="366" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnj6GMz4q-763APLxi7BYYyYDYNSIXQepkja50BApca9MnS0pZx4HmB7wooVCNodBLIpXe69Z32nSc30hIL0T5ZXCwfWn_FGOMaUkWSU_F04pvCTfSO95sLqmrpMmfU4nzxcJC/s640/image+5.png" width="640" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Once you have a package built, you choose the PCs to push the package to. This can be from Active Directory, from a collection in PDQ Inventory, or even from a text file. We typically push out to about 10 PCs at a time. For PCs in other offices, we use a DFSR share to replicate all of the installation files to each office. Then the packages use a DFS namespace that is identical in each office to do the install from.<br />
<br />
Here is the output for a package that installs AutoCAD Architecture 2016 (w/ SPs and hotfixes), uninstalls all pre-2015 Autodesk software on the PC, installs Revit 2016 (w/ addins, updates, ini files, etc), and Bluebeam PDF.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXCZWhi8Jqg5fDPxgsnpPYiKcunR9bG1HsAWTAY2t9OTS8whF5hppitn7S9nP0yORouNnbXeDQxbxONvnNNG333kahIrXk8orp3j04Kvsnpuly5qKUJMP2FDNde-h0zKjOFMdQ/s1600/2016+Deployment.png" imageanchor="1"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXCZWhi8Jqg5fDPxgsnpPYiKcunR9bG1HsAWTAY2t9OTS8whF5hppitn7S9nP0yORouNnbXeDQxbxONvnNNG333kahIrXk8orp3j04Kvsnpuly5qKUJMP2FDNde-h0zKjOFMdQ/s1600/2016+Deployment.png" /></a><br />
<br />
<br />
<h2>
Conclusion</h2>
<br />
There are lots of other features that I won't touch on that include scheduling, automatic (start install when computer comes on), pre-made packages, and lots more.<br />
<br />
The pair of applications have saved us countless hours for deploying software that the savings are probably immeasurable. If you want to try this out, the company has trial versions available. And if you have more questions about how we use it, please feel free to leave a comment.<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com3tag:blogger.com,1999:blog-32577727.post-17891759951567525882015-04-21T14:18:00.000-07:002015-04-21T14:18:33.880-07:00RevitLookup for Revit 2016With Revit 2016 officially out, I am working on updating my addins for 2016. One of the most invaluable addins has already been updated. Per Jeremy Tammik on his website, <a href="http://thebuildingcoder.typepad.com/blog/2015/04/revit-2016-api-news-and-devdays-online-recording.html" target="_blank">http://thebuildingcoder.typepad.com/blog/2015/04/revit-2016-api-news-and-devdays-online-recording.html</a>, RevitLookup has been updated for Revit 2016.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR-sTt7CvDUlu3Rny5ugoBxDGatDRXuR2exKTXhEun_24liV96b-hhOgOOm6tiQ4OdshxL93QmeFmDKBdwpfNAGTtP7F-KrmRkRhXHWH8f63ZLl51PrYaEDeHKCxqzsUY0K3in/s1600/RevitLookup2016.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR-sTt7CvDUlu3Rny5ugoBxDGatDRXuR2exKTXhEun_24liV96b-hhOgOOm6tiQ4OdshxL93QmeFmDKBdwpfNAGTtP7F-KrmRkRhXHWH8f63ZLl51PrYaEDeHKCxqzsUY0K3in/s1600/RevitLookup2016.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
You can get the source code here: <a href="https://github.com/jeremytammik/RevitLookup/releases/tag/2016.0.0.6" target="_blank">https://github.com/jeremytammik/RevitLookup/releases/tag/2016.0.0.6</a> and build it yourself.<br />
<br />
Or you can download a zip with a version that I have already built here: <a href="https://app.box.com/s/5hxbjrtgk77a80uwvycvfxinjvo9tzvt" target="_blank">https://app.box.com/s/5hxbjrtgk77a80uwvycvfxinjvo9tzvt</a><br />
<br />
Just extract the contents of the zip file into your Revit 2016 addins folder ( <u>C:\ProgramData\Autodesk\Revit\Addins\2016\</u> )Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com6tag:blogger.com,1999:blog-32577727.post-12628596273933872942015-04-02T12:50:00.003-07:002015-04-02T12:50:23.492-07:00Convert View Names on Sheets to UPPERCASEHere is a quick little Revit Macro that will change all the View names on Sheets to UPPERCASE. This helps when browsing through the Project Browser to identify which views are placed on Sheets. It is one directional at the moment, so if a view that is already UPPERCASE is not on a sheet anymore it won't change it back to lowercase. If I add this in the future I will post an update then.<br />
<br />
<br />
<span style="font-size: x-small;"><span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">SheetViewNamesToUppercase</span>()<br />
{<br />
Document doc =
<span style="font-weight: bold;">this</span>.ActiveUIDocument.Document;<br />
<br />
<span style="color: green; font-weight: bold;">using</span>(Transaction t = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">Transaction</span>(doc, <span style="color: blue;">"Sheet View Names to Uppercase"</span>))<br />
{<br />
t.<span style="color: midnightblue; font-weight: bold;">Start</span>();<br />
<br />
<span style="color: blue; font-weight: bold;">foreach</span>(ViewSheet vs <span style="color: blue; font-weight: bold;">in</span> <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(ViewSheet)))<br />
{<br />
<span style="color: blue; font-weight: bold;">foreach</span>(ElementId eid <span style="color: blue; font-weight: bold;">in</span> vs.<span style="color: midnightblue; font-weight: bold;">GetAllPlacedViews</span>())<br />
{<br />
<span style="color: teal; font-weight: bold;">try</span><br />
{<br />
View v = doc.<span style="color: midnightblue; font-weight: bold;">GetElement</span>(eid) <span style="color: darkcyan; font-weight: bold;">as</span> View;<br />
v.Name = v.Name.<span style="color: midnightblue; font-weight: bold;">ToUpper</span>();<br />
}<br />
<span style="color: teal; font-weight: bold;">catch</span><br />
{ <br />
}<br />
<br />
}<br />
}<br />
<br />
<span style="color: blue; font-weight: bold;">foreach</span> (ViewSchedule vsc <span style="color: blue; font-weight: bold;">in</span> <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(ViewSchedule)))<br />
{<br />
<span style="color: blue; font-weight: bold;">foreach</span> (ScheduleSheetInstance ssi <span style="color: blue; font-weight: bold;">in</span> <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(ScheduleSheetInstance)))<br />
{<br />
<span style="color: blue; font-weight: bold;">if</span> (vsc.Name == ssi.Name)<br />
{<br />
<span style="color: teal; font-weight: bold;">try</span><br />
{<br />
vsc.Name = vsc.Name.<span style="color: midnightblue; font-weight: bold;">ToUpper</span>();<br />
}<br />
<span style="color: teal; font-weight: bold;">catch</span><br />
{ <br />
}<br />
<br />
}<br />
}<br />
}<br />
<br />
t.<span style="color: midnightblue; font-weight: bold;">Commit</span>();<br />
}<br />
}</span>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com3tag:blogger.com,1999:blog-32577727.post-28201489591990639472015-02-20T10:38:00.000-08:002015-02-20T10:38:11.954-08:00Quick Macro for Duplicating an Existing Sheet and ViewsI had someone recently ask me if it was possible to duplicate a sheet and it's views in Revit. It isn't possible within Revit by default, but with a little bit of code, I was able to get a macro that would duplicate the sheet and it's views. Give the macro a try, just make sure you are in a sheet view before running the macro.<br />
<br />
<i>Note: the duplicated views and sheets are renamed with "-DUP" since they need to be unique in Revit. You can change this in the code to be anything you want.</i><br />
<br />
<span style="font-size: x-small;"><span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">DuplicateSheet</span>()<br />
{<br />
UIDocument uidoc = <span style="font-weight: bold;">this</span>.ActiveUIDocument;<br />
Document doc = uidoc.Document;<br />
ViewSheet vs = doc.ActiveView <span style="color: darkcyan; font-weight: bold;">as</span> ViewSheet;<br />
<br />
<span style="color: green; font-weight: bold;">using</span>(Transaction t = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">Transaction</span>(doc, <span style="color: blue;">"Duplicate Sheet"</span>))<br />
{<br />
t.<span style="color: midnightblue; font-weight: bold;">Start</span>();<br />
<br />
FamilyInstance titleblock = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(FamilyInstance))<br />
.<span style="color: midnightblue; font-weight: bold;">OfCategory</span>(BuiltInCategory.OST_TitleBlocks).Cast<FamilyInstance>()<br />
.<span style="color: midnightblue; font-weight: bold;">First</span>(q => q.OwnerViewId == vs.Id);<br />
<br />
ViewSheet newsheet = ViewSheet.<span style="color: midnightblue; font-weight: bold;">Create</span>(doc, titleblock.<span style="color: midnightblue; font-weight: bold;">GetTypeId</span>());<br />
newsheet.SheetNumber = vs.SheetNumber + <span style="color: blue;">"-DUP"</span>;<br />
newsheet.Name = vs.Name;<br />
<br />
<span style="color: green;">// all views but schedules</span><br />
<span style="color: blue; font-weight: bold;">foreach</span>(ElementId eid <span style="color: blue; font-weight: bold;">in</span> vs.<span style="color: midnightblue; font-weight: bold;">GetAllPlacedViews</span>())<br />
{<br />
View ev = doc.<span style="color: midnightblue; font-weight: bold;">GetElement</span>(eid) <span style="color: darkcyan; font-weight: bold;">as</span> View;<br />
<br />
View newview = <span style="font-weight: bold;">null</span>;<br />
<br />
<span style="color: green;">// legends</span><br />
<span style="color: blue; font-weight: bold;">if</span> (ev.ViewType == ViewType.Legend)<br />
{<br />
newview = ev;<br />
}<br />
<span style="color: green;">// all non-legend and non-schedule views</span><br />
<span style="color: blue; font-weight: bold;">else</span><br />
{<br />
ElementId newviewid = ev.<span style="color: midnightblue; font-weight: bold;">Duplicate</span>(ViewDuplicateOption.WithDetailing);<br />
newview = doc.<span style="color: midnightblue; font-weight: bold;">GetElement</span>(newviewid) <span style="color: darkcyan; font-weight: bold;">as</span> View;<br />
newview.Name = ev.Name + <span style="color: blue;">"-DUP"</span>;<br />
}<br />
<br />
<span style="color: blue; font-weight: bold;">foreach</span> (Viewport vp <span style="color: blue; font-weight: bold;">in</span> <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(Viewport)))<br />
{<br />
<br />
<span style="color: blue; font-weight: bold;">if</span> (vp.SheetId == vs.Id && vp.ViewId == ev.Id)<br />
{<br />
BoundingBoxXYZ vpbb = vp.<span style="color: midnightblue; font-weight: bold;">get_BoundingBox</span>(vs);<br />
XYZ initialCenter = (vpbb.Max + vpbb.Min) / <span style="color: darkblue;">2</span>;<br />
<br />
Viewport newvp = Viewport.<span style="color: midnightblue; font-weight: bold;">Create</span>(doc, newsheet.Id, newview.Id, XYZ.Zero);<br />
<br />
BoundingBoxXYZ newvpbb = newvp.<span style="color: midnightblue; font-weight: bold;">get_BoundingBox</span>(newsheet);<br />
XYZ newCenter = (newvpbb.Max + newvpbb.Min) / <span style="color: darkblue;">2</span>;<br />
<br />
ElementTransformUtils.<span style="color: midnightblue; font-weight: bold;">MoveElement</span>(doc, newvp.Id, <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">XYZ</span>(<br />
initialCenter.X - newCenter.X,<br />
initialCenter.Y - newCenter.Y,<br />
<span style="color: darkblue;">0</span>));<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
<span style="color: green;">// schedules</span><br /> <br />
<span style="color: blue; font-weight: bold;">foreach</span> (ScheduleSheetInstance si <span style="color: blue; font-weight: bold;">in</span> (<span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(ScheduleSheetInstance))))<br />
{<br />
<span style="color: blue; font-weight: bold;">if</span> (si.OwnerViewId == vs.Id)<br />
{<br />
<span style="color: blue; font-weight: bold;">if</span> (!si.IsTitleblockRevisionSchedule)<br />
{ <br />
<span style="color: blue; font-weight: bold;">foreach</span> (ViewSchedule vsc <span style="color: blue; font-weight: bold;">in</span> <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc).<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(ViewSchedule)))<br />
{<br />
<span style="color: blue; font-weight: bold;">if</span> (si.ScheduleId == vsc.Id)<br />
{<br />
BoundingBoxXYZ sibb = si.<span style="color: midnightblue; font-weight: bold;">get_BoundingBox</span>(vs);<br />
XYZ initialCenter = (sibb.Max + sibb.Min) / <span style="color: darkblue;">2</span>;<br />
<br />
ScheduleSheetInstance newssi = ScheduleSheetInstance.<span style="color: midnightblue; font-weight: bold;">Create</span>(doc, newsheet.Id, vsc.Id, XYZ.Zero);<br />
<br />
BoundingBoxXYZ newsibb = newssi.<span style="color: midnightblue; font-weight: bold;">get_BoundingBox</span>(newsheet);<br />
XYZ newCenter = (newsibb.Max + newsibb.Min) / <span style="color: darkblue;">2</span>;<br />
<br />
ElementTransformUtils.<span style="color: midnightblue; font-weight: bold;">MoveElement</span>(doc, newssi.Id, <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">XYZ</span>(<br />
initialCenter.X - newCenter.X,<br />
initialCenter.Y - newCenter.Y,<br />
<span style="color: darkblue;">0</span>));<br />
}<br />
}<br />
}<br />
<br />
}<br />
}<br />
<br />
<br />
t.<span style="color: midnightblue; font-weight: bold;">Commit</span>();<br />
}<br />
<br />
}</span>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com31tag:blogger.com,1999:blog-32577727.post-39468291713808289202015-02-11T17:33:00.000-08:002015-02-20T10:38:33.797-08:00Revit Macro for Mass Importing Shared ParametersThe following was a quick attempt to see if I could mass import a bunch of shared parameters into my projects. Its part of a tool I am building that needed some unique parameters for schedules and tags.<br />
<br />
<span style="font-size: x-small;"><span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">ImportSharedParameters</span>()<br />
{<br />
UIDocument uidoc = <span style="font-weight: bold;">this</span>.ActiveUIDocument;<br />
Document doc = uidoc.Document;<br />
<br />
<span style="color: green;">// location of shared parameters file</span><br />
<span style="color: red;">string</span> spfile = <span style="color: blue;">@"</span><span style="color: blue;">\\corp.ktgy.com\bim\DT\API\Unit Coin\Shared Parameter-KTGY.txt"</span>;<br />
<br />
<span style="color: green; font-weight: bold;">using</span> (Transaction t = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">Transaction</span>(doc, <span style="color: blue;">"Import Shared Parameters"</span>))<br />
{<br />
t.<span style="color: midnightblue; font-weight: bold;">Start</span>();<br /> </span><br />
<span style="font-size: x-small;"> </span><span style="color: green; font-size: x-small;">// create a new line for each parameter like this:</span><br />
<span style="font-size: x-small;"><span style="color: green;"> // doc, SharedParametersFile, ParameterName, Category, ParameterGroup, VaryByGroupInstance</span>
<span style="color: midnightblue; font-weight: bold;">CreateProjParameter</span>(doc, spfile, <span style="color: blue;">"Building"</span>, BuiltInCategory.OST_Rooms, BuiltInParameterGroup.PG_IDENTITY_DATA, <span style="color: darkcyan; font-weight: bold;">true</span>);<br />
<span style="color: midnightblue; font-weight: bold;">CreateProjParameter</span>(doc, spfile, <span style="color: blue;">"Unit Area"</span>, BuiltInCategory.OST_Rooms, BuiltInParameterGroup.PG_GENERAL, <span style="color: darkcyan; font-weight: bold;">true</span>);<br />
<br />
t.<span style="color: midnightblue; font-weight: bold;">Commit</span>();<br />
}<br />
}</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">CreateProjParameter</span>( Document doc, <span style="color: red;">string</span> sharedParameterFile, <span style="color: red;">string</span> parameterName,<br />
BuiltInCategory bicategory, BuiltInParameterGroup bipgroup, Boolean varyByGroup)<br />
{<br />
<span style="color: green;">// load the shared parameters file</span><br />
Application.SharedParametersFilename = sharedParameterFile;<br />
<br />
<span style="color: green;">// select the category</span><br />
Category cat = doc.Settings.Categories.<span style="color: midnightblue; font-weight: bold;">get_Item</span>(bicategory);<br />
<span style="color: green;">// create a new category set</span><br />
CategorySet catset = Application.Create.<span style="color: midnightblue; font-weight: bold;">NewCategorySet</span>();<br />
<span style="color: green;">// add category to category set</span><br />
catset.<span style="color: midnightblue; font-weight: bold;">Insert</span>(cat);<br />
<br />
<span style="color: green;">// loaded shared parameter file</span><br />
DefinitionFile deffile = Application.<span style="color: midnightblue; font-weight: bold;">OpenSharedParameterFile</span>();<br />
<br />
<span style="color: teal; font-weight: bold;">try</span><br />
{<br />
<span style="color: green;">// find the parameter in the shared parameters file</span><br />
<span style="color: green;">// by searching each parameter group</span><br />
<span style="color: navy;">var</span> v = (<span style="color: navy;">from</span> DefinitionGroup dg <span style="color: blue; font-weight: bold;">in</span> deffile.Groups<br />
<span style="color: navy;">from</span> ExternalDefinition d <span style="color: blue; font-weight: bold;">in</span> dg.Definitions<br />
<span style="color: navy;">where</span> d.Name == parameterName<br />
<span style="color: navy;">select</span> d);<br />
<br />
ExternalDefinition def = v.<span style="color: midnightblue; font-weight: bold;">First</span>();<br />
<br />
<span style="color: green;">// bind the parameter to the category and parameter group</span><br />
Binding binding = Application.Create.<span style="color: midnightblue; font-weight: bold;">NewInstanceBinding</span>(catset);<br />
BindingMap map = doc.ParameterBindings;<br />
map.<span style="color: midnightblue; font-weight: bold;">Insert</span>(def, binding, bipgroup);<br />
<br />
<span style="color: green;">// change parameter to be "Values can vary by group instance"</span><br />
<span style="color: blue; font-weight: bold;">if</span>(varyByGroup)<br />
{<br />
BindingMap grpmap = doc.ParameterBindings;<br />
DefinitionBindingMapIterator it = grpmap.<span style="color: midnightblue; font-weight: bold;">ForwardIterator</span>();<br />
<br />
<span style="color: blue; font-weight: bold;">while</span> (it.<span style="color: midnightblue; font-weight: bold;">MoveNext</span>())<br />
{<br />
Definition d = it.Key <span style="color: darkcyan; font-weight: bold;">as</span> Definition;<br />
<span style="color: blue; font-weight: bold;">if</span> (d.Name == parameterName)<br />
{<br />
InternalDefinition idef = it.Key <span style="color: darkcyan; font-weight: bold;">as</span> InternalDefinition;<br />
idef.<span style="color: midnightblue; font-weight: bold;">SetAllowVaryBetweenGroups</span>(doc, <span style="color: darkcyan; font-weight: bold;">true</span>);<br />
}<br />
}<br />
}<br />
<br />
}<br />
<span style="color: teal; font-weight: bold;">catch</span> (Exception ex)<br />
{<br />
TaskDialog.<span style="color: midnightblue; font-weight: bold;">Show</span>(<span style="color: blue;">"Error"</span>, ex.Message);<br />
}<br />
}</span>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com4tag:blogger.com,1999:blog-32577727.post-71423951801927549502015-01-15T14:56:00.001-08:002015-01-15T14:56:51.063-08:00BIM Consortium Revit Addin Bug Fix EditionI uploaded a new build of the BIM Consortium Addin today with quite a few bug fixes. The most notable ones being...<br />
<br />
<ul>
<li>Delete Unused Views would crash Revit randomly. Tool completely re-written to be more stable</li>
</ul>
<div>
<ul>
<li>Rooms to 3D Views and the Room 3D Tags shouldn't error out when there are un-bounded or non-placed rooms anymore</li>
</ul>
<div>
If you come across any other bugs, make sure to shoot me an email at <a href="mailto:troygates@gmail.com">troygates@gmail.com</a>.</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Download <a href="https://app.box.com/s/blob2mn6je0tnhkai4q8fj2wkuukzvox" target="_blank">HERE</a> </div>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0tag:blogger.com,1999:blog-32577727.post-10251502747611001352014-07-21T17:17:00.002-07:002015-01-15T15:02:05.545-08:00BIMConsortium Revit Addin Update + New Tools + 2015 Compatible<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjAu9ItQzgwmZQ1ImxS_5bkHgUMc0HuN7kQ2CNtxbbJsSEKRZ3azIAwZUatC4E0iib0PqveR8iO92aepoLqHgtLb1yVY4V_dnYrrWM3Xhoy3KZx1gpHp5dNd3iMWhAlWzNnR_v/s1600/Toolbar.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjAu9ItQzgwmZQ1ImxS_5bkHgUMc0HuN7kQ2CNtxbbJsSEKRZ3azIAwZUatC4E0iib0PqveR8iO92aepoLqHgtLb1yVY4V_dnYrrWM3Xhoy3KZx1gpHp5dNd3iMWhAlWzNnR_v/s1600/Toolbar.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
A new update is available located here: <a href="http://revitcoaster.blogspot.com/2015/01/bim-consortium-revit-addin-bug-fix.html" target="_blank">BIMCon_Addin_1.2.zip</a><br />
<br />
<br />
<u><span style="font-size: x-large;">Updated</span></u><br />
<ul>
<li>Addin now supports both Revit 2014 and 2015</li>
<li><b>Delete Views</b> - Added option to delete all views NOT on a Sheet</li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnLHmcx1OCWoISbSzfX1PYtfRqMS78IR4VIdkMAHv0ev_szgTihh3xtPAMYFdU0Xl1e4-tNcNge9wFkLnf52vkqFcSz98MYuTXZewt_SzzgjGmNgcf-VNEqRbdvNH0tqiADF_r/s1600/Delete_Views.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnLHmcx1OCWoISbSzfX1PYtfRqMS78IR4VIdkMAHv0ev_szgTihh3xtPAMYFdU0Xl1e4-tNcNge9wFkLnf52vkqFcSz98MYuTXZewt_SzzgjGmNgcf-VNEqRbdvNH0tqiADF_r/s1600/Delete_Views.png" height="297" width="320" /></a></div>
<br />
<br />
<br />
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<span style="font-size: large;"><u><br /></u></span>
<u><span style="font-size: x-large;">New</span></u><br />
<span style="font-size: large;"><u><br /></u></span>
<b>3D Room Tags</b><br />
This tool will place a generic family with 3D text into the center of every room at the specified height above the room's level. Load the included family <i>Room Tag 3D BIMCon.rfa. </i>This family can be modified to what you want it to look like as long as it keeps the same name. I will add an option in the future to pick a family of your own.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6-mVQ_CWuzGmOpGZvlNrMiypi6PFCpHUCaq6iN1G_E5eebXpsi2M_I_YrV6IyErEPJQTgYD9yXQxeE58FfOJCVReEQhGgRO-q26PCLGhzFFfT9nS2kzs5jExQkTehV7IPAa4P/s1600/3D_Room_Tags.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6-mVQ_CWuzGmOpGZvlNrMiypi6PFCpHUCaq6iN1G_E5eebXpsi2M_I_YrV6IyErEPJQTgYD9yXQxeE58FfOJCVReEQhGgRO-q26PCLGhzFFfT9nS2kzs5jExQkTehV7IPAa4P/s1600/3D_Room_Tags.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b>Room to 3D Views</b><br />
This tool will create four (4) 3D Camera Views for every room in the model. The views are placed at lower-left and upper-right at floor and above ceiling. The heights are adjustable.<br />
<br />
<i>* Note: Because of how the API determines a room boundary as a rectangular box, the cameras may be located outside the actual rooms.</i><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7oV40ZWiPJdtGflBbEWSxBYonWBYapFvV-eMYyNaO3AXFMyNVxWvA7uYs3-BWN0nWVovYUPt3J7PoA5WJVruZYFWAr4XZKt60Z4aZwKLSK8YOss9z7SMhq7Kgj6GQPpWvGbpg/s1600/Rooms_to_3D_Views.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7oV40ZWiPJdtGflBbEWSxBYonWBYapFvV-eMYyNaO3AXFMyNVxWvA7uYs3-BWN0nWVovYUPt3J7PoA5WJVruZYFWAr4XZKt60Z4aZwKLSK8YOss9z7SMhq7Kgj6GQPpWvGbpg/s1600/Rooms_to_3D_Views.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><br /></b>
<b><br /></b>
<b>Merge Text</b><br />
This tool is actually two (2) tools, Merge 2 Text and Merge Multiple Text.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9ATsPB8WsZ1LCcnfqSdfYFc1bqjpBFelcAWzkuUgPdHCRXUVScPENUanYzSmhuF6kadg-SMyhc-z2pUOHBsLvZ-U5dVedWe8FLCEcqrt8ZeEl2LlHVLUHCmgYGGd2ZAXNFGdj/s1600/Merge_Text.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9ATsPB8WsZ1LCcnfqSdfYFc1bqjpBFelcAWzkuUgPdHCRXUVScPENUanYzSmhuF6kadg-SMyhc-z2pUOHBsLvZ-U5dVedWe8FLCEcqrt8ZeEl2LlHVLUHCmgYGGd2ZAXNFGdj/s1600/Merge_Text.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The first one will take two (2) pieces of text and merge them together with several options available.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo0T7tTtHdXfLkyKL9RM1SI65cn-rvsz0hllKpd3CBIt2QtehpvRRWLzThLVqlPW3FQD9zZxWfcMfqZvIfY4EkPKUepisaQCD4RzIcr3wKCdoJrjuE8af0AxctYuSCHhou8it1/s1600/Merge_Text_2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo0T7tTtHdXfLkyKL9RM1SI65cn-rvsz0hllKpd3CBIt2QtehpvRRWLzThLVqlPW3FQD9zZxWfcMfqZvIfY4EkPKUepisaQCD4RzIcr3wKCdoJrjuE8af0AxctYuSCHhou8it1/s1600/Merge_Text_2.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The second tool will merge several text elements into the first one selected. Notice that you need to hit <b>ESC</b> to end the selection of elements.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjmPOFtkAm0eL3xhNDbQ4AL_mUPVEqySgSFZK98fWOYjnWEuBUceaylOvgEF79aByzO5Yg1YoI3CawICv5HPItLRGPlIoIxjH8ntMEpgO_mJKexlVeK8McljGcvqlG2WWfI-6e/s1600/Merge_Text_Multiple.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjmPOFtkAm0eL3xhNDbQ4AL_mUPVEqySgSFZK98fWOYjnWEuBUceaylOvgEF79aByzO5Yg1YoI3CawICv5HPItLRGPlIoIxjH8ntMEpgO_mJKexlVeK8McljGcvqlG2WWfI-6e/s1600/Merge_Text_Multiple.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><u><span style="font-size: large;">NOTE:</span></u></b><br />
If you receive an error in Revit about not being able to load the addin, go to the folder where you saved the dll file, <b>right-click</b> the file and go to <b>properties</b>. In the properties dialog click the button to <b>Unblock </b>the file.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4wBITXFRxlXkH-ofC3DDar1WktzLDw3LVT6LmIvMWY8bFECSJjF-yT0A_BZpQGvHNnDDmDYZA46Smzc2iw_2HkRzZUXqumlC-ISilM8hjTRlVu2B1kmyiNPbTE4hA4qAsh1tV/s1600/dllproperties.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4wBITXFRxlXkH-ofC3DDar1WktzLDw3LVT6LmIvMWY8bFECSJjF-yT0A_BZpQGvHNnDDmDYZA46Smzc2iw_2HkRzZUXqumlC-ISilM8hjTRlVu2B1kmyiNPbTE4hA4qAsh1tV/s1600/dllproperties.png" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com1tag:blogger.com,1999:blog-32577727.post-33042898246944022432014-06-24T15:11:00.000-07:002014-06-24T15:11:20.730-07:00Revit Lookup 2015 AddinDuring my class (<b><i>BIM Managers Guide to Automating Revit Using Macros</i></b>) at <a href="http://www.cvent.com/events/rtc-north-america-2014/event-summary-208bff0be0e044f58fa2e72c9955e27f.aspx" target="_blank">RTC</a> in Schaumburg (Chicago) last week, I mentioned the Revit Lookup addin. Afterwards several people asked where they could download a compiled version. I compiled the most recent source from <a href="https://github.com/jeremytammik/RevitLookup/" target="_blank">https://github.com/jeremytammik/RevitLookup/</a> and uploaded it to my blog so you can download it (below).<br />
<br />
<b><u>Download</u></b><br />
<a href="https://docs.google.com/file/d/0B7VxBYKCiaH7YllnRzQ2QUlFc2M/edit?pli=1" target="_blank">Revit Lookup 2015</a><br />
<br />
<b><u>Install Instructions</u></b><br />
Extract the 2 files to <i>C:\ProgramData\Autodesk\Revit\Addins\2015\</i><br />
<br />
<br />
<i>If you are interested in 2013 and 2014 versions you can find them in a blog post from last year: <a href="http://revitcoaster.blogspot.com/2013/09/creating-macros-larug-sept-2013.html">http://revitcoaster.blogspot.com/2013/09/creating-macros-larug-sept-2013.html</a> </i>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com5tag:blogger.com,1999:blog-32577727.post-8082449473366244272014-06-05T11:48:00.002-07:002014-06-05T13:46:17.426-07:00View Schedule with Detail Numbers Macro for RevitA question was posted on <a href="http://revitforum.org/">http://revitforum.org</a> about showing a view's detail number in a view list schedule. Revit has a parameter for the Detail Number (see first image) but it isn't accessible to add in a view list schedule.<br />
<br />
<i>Original post: <a href="http://www.revitforum.org/architecture-general-revit-questions/20119-detail-number-view-list-schedule.html">http://www.revitforum.org/architecture-general-revit-questions/20119-detail-number-view-list-schedule.html</a></i><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwxw3kAssocA8iHb_FiNPBrvVLg7hWU0tCICvyd0jMz-1dqVNXzpJDsNF7njM5TGhYiqDatWMEpvJtlecJy6rqAucr6CGlWcM4iPOSur56GqQMnnmw07so844k0NpnDTODMoP5/s1600/Properties.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwxw3kAssocA8iHb_FiNPBrvVLg7hWU0tCICvyd0jMz-1dqVNXzpJDsNF7njM5TGhYiqDatWMEpvJtlecJy6rqAucr6CGlWcM4iPOSur56GqQMnnmw07so844k0NpnDTODMoP5/s1600/Properties.png" height="338" width="640" /></a></div>
<br />
<br />
<br />
<br />
<br />
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b>Solution</b></span><br />
<br />
<u><b>Step 1</b></u><br />
Create a <b>View List schedule</b> (or edit an existing one) and add a new <b>text Parameter</b> named "<b>Detail_Number</b>" (notice the _ in the name)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidvJ87uuFh5ivecR44ThQarNG21g4zWPtXokIZE9z5ZuWtHcGUq9VqDNQb1tlx3VAorK7XsmrdbItB4kTSC5kJBING6KuNZ22x2zdtI4jDzNxk05D-TVHEjhNPMSTsxQnX65sx/s1600/Create_Parameter.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidvJ87uuFh5ivecR44ThQarNG21g4zWPtXokIZE9z5ZuWtHcGUq9VqDNQb1tlx3VAorK7XsmrdbItB4kTSC5kJBING6KuNZ22x2zdtI4jDzNxk05D-TVHEjhNPMSTsxQnX65sx/s1600/Create_Parameter.png" height="462" width="640" /></a></div>
<br />
<b><u><br /></u></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJa1rXLilrQHkNCRmuMIGGvrM29gwC6uwirCj_NNHzVMo-BM5m3kU7-0bGde91TtBIu_pLDQEs9AijYPl15x3op46SbizjQPEUMBbuTv34nXo67ghZgmoPMMFQxQGEd9_q17Nn/s1600/View_List_Schedule_Before.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJa1rXLilrQHkNCRmuMIGGvrM29gwC6uwirCj_NNHzVMo-BM5m3kU7-0bGde91TtBIu_pLDQEs9AijYPl15x3op46SbizjQPEUMBbuTv34nXo67ghZgmoPMMFQxQGEd9_q17Nn/s1600/View_List_Schedule_Before.png" /></a></div>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u><br /></u></b>
<b><u>Step 2</u></b><br />
Create a <b>new macro</b> with the following routine and run it<br />
<br />
<span style="font-size: x-small;"><span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">DetailNumber</span>()<br />
{<br />
UIDocument uidoc = <span style="font-weight: bold;">this</span>.ActiveUIDocument;<br />
Document doc = uidoc.Document;<br />
<br />
<span style="color: red;">string</span> strDetailNumber = <span style="color: blue;">"Detail_Number"</span>; <br />
<br />
FilteredElementCollector collector = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc);<br />
ICollection<Element> collection = collector.<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(View)).<span style="color: midnightblue; font-weight: bold;">ToElements</span>();<br />
<br />
<span style="color: green; font-weight: bold;">using</span> (Transaction t = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">Transaction</span>(doc, <span style="color: blue;">"Detail Number"</span>))<br />
{<br />
t.<span style="color: midnightblue; font-weight: bold;">Start</span>();<br />
<br />
<span style="color: blue; font-weight: bold;">foreach</span>(Element e <span style="color: blue; font-weight: bold;">in</span> collection)<br />
{<br />
View v = e <span style="color: darkcyan; font-weight: bold;">as</span> View;<br />
<br />
<span style="color: teal; font-weight: bold;">try</span><br />
{<br />
Parameter bpDetailNumber = v.<span style="color: midnightblue; font-weight: bold;">get_Parameter</span>(BuiltInParameter.VIEWPORT_DETAIL_NUMBER);<br />
v.<span style="color: midnightblue; font-weight: bold;">get_Parameter</span>(strDetailNumber).<span style="color: midnightblue; font-weight: bold;">Set</span>(bpDetailNumber.<span style="color: midnightblue; font-weight: bold;">AsString</span>());<br />
}<br />
<span style="color: teal; font-weight: bold;">catch</span><br />
{<br />
<br />
}<br />
<br />
}<br />
<br />
t.<span style="color: midnightblue; font-weight: bold;">Commit</span>();<br />
}<br />
}</span><br />
<span style="font-size: x-small;"><br /></span>
<b><u>Results</u></b><br />
All the views that are on sheets now have the Detail Number copied into the Detail_Number parameter.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2a0aOwxK9RhyY7NO8MF52P4cOzhFfu5RW3l9CIdUradODlISBbp3Bkt8o585OfTGNBXTwPqfUHWI4sx1QFISPNA1wb2vRVbWHv8NtKEvBO-NFTfNjMBO94ucyC8f3grBV6R0i/s1600/View_List_Schedule_After.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2a0aOwxK9RhyY7NO8MF52P4cOzhFfu5RW3l9CIdUradODlISBbp3Bkt8o585OfTGNBXTwPqfUHWI4sx1QFISPNA1wb2vRVbWHv8NtKEvBO-NFTfNjMBO94ucyC8f3grBV6R0i/s1600/View_List_Schedule_After.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><i>Run the macro whenever you want to update the values in the new parameter to reflect the current state of the project (aka is doesn't auto update and needs to be run manually).</i></b>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com14tag:blogger.com,1999:blog-32577727.post-17114051117371744252014-02-12T12:52:00.001-08:002014-02-12T12:52:53.515-08:00BIM Consortium Addin Updated With New Tool<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO-Ge8yS0QBc7ccMK-JcCuaXtG7yTSRYjH2CcgjhTIm6f5edTUd5smwnAkj7AmcnNS9O_N1zNoVLtH1JJLxWA2xI9eFnH1_JsiJ-rp5ynaKsWyYUi2LYpeuGO0CAAuG1Bvdmpj/s1600/BIMCon_Ribbon_1.1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO-Ge8yS0QBc7ccMK-JcCuaXtG7yTSRYjH2CcgjhTIm6f5edTUd5smwnAkj7AmcnNS9O_N1zNoVLtH1JJLxWA2xI9eFnH1_JsiJ-rp5ynaKsWyYUi2LYpeuGO0CAAuG1Bvdmpj/s1600/BIMCon_Ribbon_1.1.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
A new update has been uploaded of the BIM Consortium Revit Addin. The new release adds some polish to the existing tools and also adds a new tool. Hope you enjoy them as much as I had making them.<br />
<br />
Download: <a href="https://drive.google.com/file/d/0B16E2YBKmeUtbmZsNDFIUmJHMm8/edit">https://drive.google.com/file/d/0B16E2YBKmeUtbmZsNDFIUmJHMm8/edit</a><br />
<br />
<br />
<br /><span style="font-weight: normal;"><span style="font-size: x-large;"></span></span>
<u><b>Dependent Views from Scope Boxes (New)</b></u><br />
This new tool will allow you to create dependent views for any number of floor or ceiling plans and apply a Scope Box to them. This tool was created for setting up projects that have multiple work areas divided up using scope boxes.<br />
<br /><span style="font-weight: normal;"><span style="font-size: x-large;"></span></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9HgrbmX3HVEdIhi3gSilaTuP8_a_sOGlLy1eu5Dks4BOFxKe5oxd3CmC-ykil-XliyYZZr0_TxTxsfmfOtqyKMd_R-w9RoTcnW8lBBP08OZi1Ivjm-K8xRHyvMSxOZfpn87uw/s1600/Dependents_Scope_Boxes_1.1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9HgrbmX3HVEdIhi3gSilaTuP8_a_sOGlLy1eu5Dks4BOFxKe5oxd3CmC-ykil-XliyYZZr0_TxTxsfmfOtqyKMd_R-w9RoTcnW8lBBP08OZi1Ivjm-K8xRHyvMSxOZfpn87uw/s1600/Dependents_Scope_Boxes_1.1.png" /></a></div>
<br /><span style="font-weight: normal;"><span style="font-size: x-large;"></span></span>
<br /><span style="font-weight: normal;"><span style="font-size: x-large;"></span></span>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<u><b>Dependent Views (Updated)</b></u><br />
The tool now has an interface that allows you to pick how many dependent views you want to duplicate of the current view.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6vcxaFWZYoGZ1DsgeEZYTjiYMlzXMwnLdFF1E83PTHNLn_49yzczAqBR5QGsUtxgjLdCcyUtV2BGa7oRNGZtG1qRBB0VLB9pXLehBnYwAduiYiqzybtnylYLfzMTXYMwJr3Qr/s1600/Duplicate_Views_1.1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6vcxaFWZYoGZ1DsgeEZYTjiYMlzXMwnLdFF1E83PTHNLn_49yzczAqBR5QGsUtxgjLdCcyUtV2BGa7oRNGZtG1qRBB0VLB9pXLehBnYwAduiYiqzybtnylYLfzMTXYMwJr3Qr/s1600/Duplicate_Views_1.1.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<u><b>Delete Views (Updated)</b></u><br />
Added a logo to the dialog box.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMdwpPA5qGXpCOTjYPhgOOJW5RH4XeIj-sLgM__sgQ2-DA-dWc4B-vMXMw1Bt4AirsXT2w2zh9TKVbU65PfJl0wKwip4FmcIDIOCYwTlREcwvPH9PAq3mEaacj82XGsWLDZog/s1600/Delete_Views_1.1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMdwpPA5qGXpCOTjYPhgOOJW5RH4XeIj-sLgM__sgQ2-DA-dWc4B-vMXMw1Bt4AirsXT2w2zh9TKVbU65PfJl0wKwip4FmcIDIOCYwTlREcwvPH9PAq3mEaacj82XGsWLDZog/s1600/Delete_Views_1.1.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<u><b>3D Grid Creator (Updated)</b></u><br />
Added a logo to the dialog box.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAzMTncK_kcY_Ly0YvMuWW3yjM_I5bpWjw6HL82SAiE2vKtigFdlXxO9YzvolSIf7ZzxoLDjxUTCbXQvDg91KNjqUtk5Jk00hLoRjaRdWJ8gTALJwcWnSq6sUG8_v70rtAK1uI/s1600/3D_Grids_1.1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAzMTncK_kcY_Ly0YvMuWW3yjM_I5bpWjw6HL82SAiE2vKtigFdlXxO9YzvolSIf7ZzxoLDjxUTCbXQvDg91KNjqUtk5Jk00hLoRjaRdWJ8gTALJwcWnSq6sUG8_v70rtAK1uI/s1600/3D_Grids_1.1.png" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com6tag:blogger.com,1999:blog-32577727.post-47116981516759068512014-01-29T18:43:00.000-08:002014-01-29T18:43:03.698-08:00BIM Consortium Revit Add-in First ReleaseI have been working with the <a href="http://losangelesrevitusersgroup.blogspot.com/" target="_blank">Los Angeles Revit Users Group</a> leadership group (known as the BIM Consortium) to start creating a set of Revit add-ins based on meeting discussions. I'm happy to announce the first release of the add-in.<br />
<br />
Download: <a href="https://drive.google.com/file/d/0B16E2YBKmeUtbmZsNDFIUmJHMm8/edit" target="_blank">https://drive.google.com/file/d/0B16E2YBKmeUtbmZsNDFIUmJHMm8/edit</a><br />
<br />
Instructions for installation are inside the zip file.<br />
<br />
<br />
This initial release comes with 3 tools...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYxKFe6hjQOXa_bTL4ap67NynjsGFTZjl2a7B4MIVTnOLUAO7AeScJ229ghGgern38VF7UkCRg4CntU6PtZxWyU4EMHhpERWWGc-llT_Dga3Lw_zqI1X6gUHmo5la4rFjxeUox/s1600/BIMCon_Ribbon_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYxKFe6hjQOXa_bTL4ap67NynjsGFTZjl2a7B4MIVTnOLUAO7AeScJ229ghGgern38VF7UkCRg4CntU6PtZxWyU4EMHhpERWWGc-llT_Dga3Lw_zqI1X6gUHmo5la4rFjxeUox/s1600/BIMCon_Ribbon_1.jpg" /></a></div>
<br />
<br /><br /><u><span style="font-size: large;">3D Grid Generator</span></u><br />
This tool is based on the <a href="http://cad-vs-bim.blogspot.com/2013/10/3d-grids-in-revit-oldie-but-goodie-done.html" target="_blank">3D Grid</a> family created by <a href="https://twitter.com/JayZallan" target="_blank">Jay Zallan</a>. Jay demoed the family during a meeting that I happened to also be discussing macros. I challenged myself to take Jay's family and create a macro that would automatically place a 3D Grid family on every grid line in the model. After several iterations, I converted the macro to an add-in and here it is.<br />
<br />
The tool is very simple. First load the 3D Grids family included with the add-in into your Revit model. Then start the tool and choose the levels that you would like to have 3D grids on. Then you can use Jay's original guide on how to use the 3D grids. Quick video demo can be found here: <a href="https://www.youtube.com/watch?v=-wSnc9-j2O8" target="_blank">https://www.youtube.com/watch?v=-wSnc9-j2O8 </a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEPemYvJvKHvu8eDwAYoab_NFjznobxaGH2W3Z-pXp_eOJrHCKn67iwGORaxx0Zz_aNIlK5IeQjFMu1WNG4wt-3XJ_Y0ndf7086I-vv7-DDV-ODDjSbfsi9wNfCHndHP4dKaw/s1600/BIMCon_3DGrids_Dialog.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEPemYvJvKHvu8eDwAYoab_NFjznobxaGH2W3Z-pXp_eOJrHCKn67iwGORaxx0Zz_aNIlK5IeQjFMu1WNG4wt-3XJ_Y0ndf7086I-vv7-DDV-ODDjSbfsi9wNfCHndHP4dKaw/s1600/BIMCon_3DGrids_Dialog.jpg" /></a></div>
<br />
<br />
<i>** The first release does have a limitation that I am working on fixing and will release in a future update. It currently won't recognize that a 3D grid already exists when creating them. So if you run the tool twice on the same level you will end up with two families in the same place and Revit will let you know. If you want to place new copies if your grid changes, for now you will need to delete the existing 3D grids before you create new ones.</i><br />
<br />
<br />
<span style="font-size: large;"><u>Create Dependent Views</u></span><br />
This tool is very simple and came as a request. It will simply duplicate as dependent the active view 5 times. Saves you 5 right-clicks.<br />
<br />
<i>** I have already received a request to add a dialog that allows you to pick your own number. It will be in a future update.</i><br />
<br />
<br />
<u><span style="font-size: large;">Delete Views</span></u><br />
This tool was the original reason I wanted to learn how to create macros in Revit. As an MEP firm I work with a lot of models from other companies. In order to keep the numerous linked models manageable, I clean the models by deleting views, legends, schedules, and sheets. I used to do this by hand by deleting them from the project browser. Now I can run this tool and get it done quickly.<br />
<br />
Word of caution, this will <span style="color: red;"><b><u>DELETE</u></b> </span>views and sheets from your currently active model. Be careful using the tool (I take no responsibility for your usage :-) ).<br />
<br />
To use the tool, start from a view you want to keep (Revit requires at least 1 view in a model). Run the tool and choose the option that best suits your model usage.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84dJPXyexUEDT2f1P3kjtQobszJg2r5q8MeGE_s9Nqc4AdO-j135fUCzUYk3jGRMeroUP0Msr5lSVUL4Ch0VIVR_5QrWf6UfIx5kZJJYVPhgc0j5vyZ1_EDEdUyDl0y1m5yp6/s1600/BIMCon_DeleteViews_Dialog.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84dJPXyexUEDT2f1P3kjtQobszJg2r5q8MeGE_s9Nqc4AdO-j135fUCzUYk3jGRMeroUP0Msr5lSVUL4Ch0VIVR_5QrWf6UfIx5kZJJYVPhgc0j5vyZ1_EDEdUyDl0y1m5yp6/s1600/BIMCon_DeleteViews_Dialog.jpg" /></a></div>
<br />
<ul>
<li><u><b>Delete All Non-Plan Views</b></u> – this option will delete all views except floor and ceiling plans. This is best for consultant models that you will be using linked views.</li>
<li><u><b>Delete All Views</b></u> – this option will delete all views in a model except the currently active one. </li>
<li><u><b>Delete All Except Containing</b></u> – this option will delete all views except ones containing the word you type in. This is best for prearranged view names for linked models. IE: another company has created views with <i>consultant</i> in the name. Type <i>consultant</i> into the box to delete all but the consultant views.</li>
<li><u><b>Delete Sheets Too</b></u> – this option will also delete all the sheets in addition to the options chosen above. </li>
</ul>
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com5tag:blogger.com,1999:blog-32577727.post-16541856336581810602014-01-29T15:39:00.000-08:002014-01-29T15:39:01.241-08:00Macro to change all families to the same LEADER ARROWHEAD styleI had a request to write a macro that would change all families' Leader Arrowhead style to the same type in a project.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji1P14h-g9acVQyVRBcibOTdH7dgmRsAMaaUXJf2EN_eU-ZeLW4dcW8buY1oYI-9lLsKDrXRhdax9nOSGAJeKe8ieDx-fJiFQC7tebk6kHG0B5SdSFbsIoDzjcC0UXne18ZoNk/s1600/Leader+Arrowhead.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji1P14h-g9acVQyVRBcibOTdH7dgmRsAMaaUXJf2EN_eU-ZeLW4dcW8buY1oYI-9lLsKDrXRhdax9nOSGAJeKe8ieDx-fJiFQC7tebk6kHG0B5SdSFbsIoDzjcC0UXne18ZoNk/s1600/Leader+Arrowhead.jpg" /></a></div>
<br />
<br />
This is the code I came up with:<br />
<br />
<br />
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> UpdateLeaders()
{
UIDocument uidoc = <span style="color: blue;">this</span>.ActiveUIDocument;
Document doc = uidoc.Document;
<span style="color: green;">// create a collection of all the Arrowhead types</span>
ElementId id = <span style="color: blue;">new</span> ElementId(BuiltInParameter.ALL_MODEL_FAMILY_NAME);
ParameterValueProvider provider = <span style="color: blue;">new</span> ParameterValueProvider(id);
FilterStringRuleEvaluator evaluator = <span style="color: blue;">new</span> FilterStringEquals();
FilterRule rule = <span style="color: blue;">new</span> FilterStringRule(provider, evaluator, <span style="color: #a31515;">"Arrowhead"</span>, <span style="color: blue;">false</span>);
ElementParameterFilter filter = <span style="color: blue;">new</span> ElementParameterFilter(rule);
FilteredElementCollector collector2 = <span style="color: blue;">new</span> FilteredElementCollector(doc).OfClass(<span style="color: blue;">typeof</span>(ElementType)).WherePasses(filter);
ElementId arrowheadId = <span style="color: blue;">null</span>;
<span style="color: green;">// loop through the collection of Arrowhead types and get the Id of a specific one</span>
<span style="color: blue;">foreach</span>(ElementId eid <span style="color: blue;">in</span> collector2.ToElementIds())
{
<span style="color: blue;">if</span>(doc.GetElement(eid).Name == <span style="color: #a31515;">"Arrow Filled 30 Degree"</span>) <span style="color: green;">//change the name to the arrowhead type you want to use</span>
{
arrowheadId = eid;
}
}
<span style="color: green;">// create a collection of all families</span>
List<Family> families = <span style="color: blue;">new</span> List<Family>(<span style="color: blue;">new</span> FilteredElementCollector(doc).OfClass(<span style="color: blue;">typeof</span>(Family)).Cast<Family>());
<span style="color: blue;">using</span>(Transaction t = <span style="color: blue;">new</span> Transaction(doc, <span style="color: #a31515;">"Update Leaders"</span>))
{
t.Start();
<span style="color: green;">// loop through all families and get their types </span>
<span style="color: blue;">foreach</span>(Family f <span style="color: blue;">in</span> families)
{
FamilySymbolSet symbols = f.Symbols;
List<FamilySymbol> symbols2 = <span style="color: blue;">new</span> List<FamilySymbol>(symbols.Cast<FamilySymbol>());
<span style="color: green;">// loop through the family types and try switching the parameter Leader Arrowhead to the one chosen above</span>
<span style="color: green;">// if the type doesn't have this parameter it will skip to the next family type</span>
<span style="color: blue;">foreach</span>(FamilySymbol fs <span style="color: blue;">in</span> symbols2)
{
<span style="color: blue;">try</span>
{
fs.get_Parameter(BuiltInParameter.LEADER_ARROWHEAD).Set(arrowheadId);
}
<span style="color: blue;">catch</span>
{
}
}
}
t.Commit();
}
}</code></pre>
<br />
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com12tag:blogger.com,1999:blog-32577727.post-60659361055300772752013-11-19T11:02:00.000-08:002013-11-19T11:02:02.382-08:00Setting an Image's Visibility to Off in a FamilyI am revamping several of our engineer's stamps for Revit 2014 and didn't want to go through the old process of converting their signature from an image to CAD and then importing to Revit. So I decided to just use the images and went to set the Visibility to a parameter and found it wasn't available (I already knew this from way back, but forgot about it).<br />
<br />
<i>Image in Family with no Parameter for Visibility </i><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu2wWJL4iWPF0uNsPZTlWuzo_UaJKzrufHQFFo3_khy-vQ4RM4NAh-KEbDorCwqc7IGEhDjAUnGQi6Ce2e2q5gQbesqcnPCbhutyGf5eqSk1nr9HBCRL4fvoJtkvS2kffDhHzq/s1600/Stamp_1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu2wWJL4iWPF0uNsPZTlWuzo_UaJKzrufHQFFo3_khy-vQ4RM4NAh-KEbDorCwqc7IGEhDjAUnGQi6Ce2e2q5gQbesqcnPCbhutyGf5eqSk1nr9HBCRL4fvoJtkvS2kffDhHzq/s1600/Stamp_1.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Looking over the small list of parameters, it hit me. Why not make the <b>Width</b> and <b>Height</b> equal to <b>0 </b>when I don't want to see the signature, thus setting it to not visible.<br />
<br />
So I setup 3 parameters called <b>Show Signature</b>, <b>Sig_W</b>, and <b>Sig_H</b>. I then linked the Image's Width to Sig_W and Height to Sig_H. Lastly I created a formula for Sig_W and Sig_H to adjust the image size off of the parameter Show Signature's value. <br />
<br />
<i>New Parameters and Formulas</i><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjVqiy2jTSLIEnO9inNBv8iEjRPuRh6SiKqTX2wUt00NfWfx6gWeytAB_471BTpwtEVn8CCYwXSJwdVKOdDY05_EAJh90HMnygAJaKq42-cUShIxcB0FwM5C8rGkB5sbs_e9e/s1600/Stamp_2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLjVqiy2jTSLIEnO9inNBv8iEjRPuRh6SiKqTX2wUt00NfWfx6gWeytAB_471BTpwtEVn8CCYwXSJwdVKOdDY05_EAJh90HMnygAJaKq42-cUShIxcB0FwM5C8rGkB5sbs_e9e/s1600/Stamp_2.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkC0syIZ-1YQ53_ptfNSAZ9jFKgkJIkdqQObQeVHUBiFIwND-M_G8T1FuUS09GmjRtxOpCOqj-AvCd_zLT0jP07A50pUkq_zTWR9P29YMrwo5WdQifzM0iOOqCFu0ar2pvG93b/s1600/Stamp_3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkC0syIZ-1YQ53_ptfNSAZ9jFKgkJIkdqQObQeVHUBiFIwND-M_G8T1FuUS09GmjRtxOpCOqj-AvCd_zLT0jP07A50pUkq_zTWR9P29YMrwo5WdQifzM0iOOqCFu0ar2pvG93b/s1600/Stamp_3.png" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<i>Linking the Width and Height to the New Parameters</i><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Ro5gQ7EXzCiA0qZ_QuW4KE3DUqMHIO2Twit7iV3Abfr_4ugB6eTXKq1DR1ytHh8-z31DlR2yBEHS0_lGsKzjKb2CJhyMSL7AYV9Cj_zsTNs2NDScDogj_KeXg2QGzJzwCuT-/s1600/Stamp_4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Ro5gQ7EXzCiA0qZ_QuW4KE3DUqMHIO2Twit7iV3Abfr_4ugB6eTXKq1DR1ytHh8-z31DlR2yBEHS0_lGsKzjKb2CJhyMSL7AYV9Cj_zsTNs2NDScDogj_KeXg2QGzJzwCuT-/s1600/Stamp_4.png" /></a></div>
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0tag:blogger.com,1999:blog-32577727.post-6086631800155600732013-11-18T14:08:00.000-08:002013-11-18T14:12:56.002-08:00Quick Macro that creates 5 Dependent Views for the Current ViewI had a user that needed to create 5 dependent views for 5 areas in a building across several views and disciplines. To save him time, I created this quick macro that will create 5 dependent views for the active view. This will save a lot of right-clicking on each view. <br />
<br />
<u><b>Code:</b></u><br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false"
DefSemiHidden="false" DefQFormat="false" DefPriority="99"
LatentStyleCount="371">
<w:LsdException Locked="false" Priority="0" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 9"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="header"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footer"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index heading"/>
<w:LsdException Locked="false" Priority="35" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of figures"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope return"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="line number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="page number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of authorities"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="macro"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="toa heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 5"/>
<w:LsdException Locked="false" Priority="10" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Closing"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Signature"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="true"
UnhideWhenUsed="true" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Message Header"/>
<w:LsdException Locked="false" Priority="11" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Salutation"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Date"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Note Heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Block Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Hyperlink"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="FollowedHyperlink"/>
<w:LsdException Locked="false" Priority="22" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Document Map"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Plain Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="E-mail Signature"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Top of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Bottom of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal (Web)"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Acronym"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Cite"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Code"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Definition"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Keyboard"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Preformatted"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Sample"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Typewriter"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Variable"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Table"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation subject"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="No List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Contemporary"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Elegant"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Professional"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Balloon Text"/>
<w:LsdException Locked="false" Priority="39" Name="Table Grid"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Theme"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" QFormat="true"
Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" QFormat="true"
Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" QFormat="true"
Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" QFormat="true"
Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" QFormat="true"
Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" QFormat="true"
Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" SemiHidden="true"
UnhideWhenUsed="true" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/>
<w:LsdException Locked="false" Priority="41" Name="Plain Table 1"/>
<w:LsdException Locked="false" Priority="42" Name="Plain Table 2"/>
<w:LsdException Locked="false" Priority="43" Name="Plain Table 3"/>
<w:LsdException Locked="false" Priority="44" Name="Plain Table 4"/>
<w:LsdException Locked="false" Priority="45" Name="Plain Table 5"/>
<w:LsdException Locked="false" Priority="40" Name="Grid Table Light"/>
<w:LsdException Locked="false" Priority="46" Name="Grid Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="Grid Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="Grid Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="46" Name="List Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="List Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="List Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 6"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
<b><span style="color: blue;">public</span></b> <span style="color: red;">void</span> <b><span style="color: midnightblue;">CreateDependentViews</span></b>()<br />
{<br />
UIDocument
uidoc = <b>this</b>.ActiveUIDocument;<br />
Document
doc = uidoc.Document;<br />
<br />
<b><span style="color: green;">using</span></b>(Transaction t = <b><span style="color: darkcyan;">new</span></b> <b><span style="color: midnightblue;">Transaction</span></b>(doc, <span style="color: blue;">"Duplicate View 5x"</span>))<br />
{<br />
t.<b><span style="color: midnightblue;">Start</span></b>();<br />
<br />
<b><span style="color: red;">int</span></b> i = <span style="color: darkblue;">0</span>;<br />
<br />
<b><span style="color: blue;">while</span></b> (i < <span style="color: darkblue;">5</span>)<br />
{<br />
uidoc.ActiveView.<b><span style="color: midnightblue;">Duplicate</span></b>(ViewDuplicateOption.AsDependent);<br />
i++;<br />
} <br />
t.<b><span style="color: midnightblue;">Commit</span></b>(); <br />
} <br />
}<br />
<br />
<br />
I expanded it a bit more and did some renaming based on Areas just to enhance it a bit.<br />
<br />
<u><b>Code:</b></u><br />
<br />
<span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">CreateDependentViews</span>()<br />
{<br />
UIDocument uidoc = <span style="font-weight: bold;">this</span>.ActiveUIDocument;<br />
Document doc = uidoc.Document;<br />
<br />
<span style="color: green; font-weight: bold;">using</span>(Transaction t = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">Transaction</span>(doc, <span style="color: blue;">"Duplicate View 5x"</span>))<br />
{<br />
t.<span style="color: midnightblue; font-weight: bold;">Start</span>();<br />
<br />
<span style="color: red; font-weight: bold;">int</span> i = <span style="color: darkblue;">0</span>;<br />
<br />
<span style="color: blue; font-weight: bold;">while</span> (i < <span style="color: darkblue;">5</span>)<br />
{<br />
ElementId dupViewId = uidoc.ActiveView.<span style="color: midnightblue; font-weight: bold;">Duplicate</span>(ViewDuplicateOption.AsDependent);<br />
View dupView = doc.<span style="color: midnightblue; font-weight: bold;">GetElement</span>(dupViewId) <span style="color: darkcyan; font-weight: bold;">as</span> View;<br />
<span style="color: red; font-weight: bold;">char</span> c = (<span style="color: red; font-weight: bold;">char</span>) (i + <span style="color: darkblue;">65</span>);<br />
dupView.Name = uidoc.ActiveView.Name + <span style="color: blue;">" - AREA "</span> + c.<span style="color: midnightblue; font-weight: bold;">ToString</span>();<br />
<br />
i++;<br />
}<br />
<br />
t.<span style="color: midnightblue; font-weight: bold;">Commit</span>(); <br />
} <br />
}</div>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com1tag:blogger.com,1999:blog-32577727.post-48522071298124025042013-10-19T12:27:00.000-07:002013-10-25T17:01:57.032-07:00Macro that Exports All Sheets to DWG <span style="background-color: red;"><span style="color: white;">***UPDATED***</span></span><br />
<i>Code has been updated to fix a bug with Sheet Placeholders causing an error. </i><br />
<br />
<a href="http://www.twitter.com/JayZallan" target="_blank">Jay Zallan</a> asked me if I could help him create a macro that would quickly export all sheets to DWG files for his consultants that only use CAD. Here is the result, a macro that will export all the sheets to DWG into a dated subfolder where the model is located. The DWGs have bound views and shared coordinates.<br />
<br />
Macro has also been added to <a href="https://bitbucket.org/BoostYourBIM/revit_api_public/" target="_blank">https://bitbucket.org/BoostYourBIM/revit_api_public/</a> <br />
<br />
Code:<br />
<span style="color: blue; font-weight: bold;">public</span> <span style="color: red;">void</span> <span style="color: midnightblue; font-weight: bold;">ExportSheetsToDWG</span>()<br />
{<br />
<span style="color: green;">// setup uidoc and doc for accessing the Revit UI (uidoc) and the Model (doc)</span><br />
UIDocument uidoc = <span style="font-weight: bold;">this</span>.ActiveUIDocument;<br />
Document doc = uidoc.Document;<br />
<br />
<span style="color: green;">// get all the elements in the model database</span><br />
FilteredElementCollector collector = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">FilteredElementCollector</span>(doc);<br />
<span style="color: green;">// filter out all elements except Views</span><br />
ICollection<Element> collection = collector.<span style="color: midnightblue; font-weight: bold;">OfClass</span>(<span style="color: darkcyan; font-weight: bold;">typeof</span>(ViewSheet)).<span style="color: midnightblue; font-weight: bold;">ToElements</span>();<br />
<br />
<span style="color: green;">// create a transaction</span><br />
<span style="color: green; font-weight: bold;">using</span>(Transaction t = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">Transaction</span>(doc, <span style="color: blue;">"Export Sheets"</span>))<br />
{<br />
<span style="color: green;">// start the transaction</span><br />
t.<span style="color: midnightblue; font-weight: bold;">Start</span>();<br />
<br />
<span style="color: green;">// create a list to hold the sheets</span><br />
List<ElementId> sheetsToDWG = <span style="color: darkcyan; font-weight: bold;">new</span> List<ElementId>();<br />
<br />
<span style="color: green;">// create DWG export options</span><br />
DWGExportOptions dwgOptions = <span style="color: darkcyan; font-weight: bold;">new</span> <span style="color: midnightblue; font-weight: bold;">DWGExportOptions</span>();<br />
dwgOptions.MergedViews = <span style="color: darkcyan; font-weight: bold;">true</span>;<br />
dwgOptions.SharedCoords = <span style="color: darkcyan; font-weight: bold;">true</span>;<br />
<br />
<span style="color: green;">// add a counter to count the sheets exported</span><br />
<span style="color: red; font-weight: bold;">int</span> x = <span style="color: darkblue;">0</span>;<br />
<br />
<span style="color: green;">// loop through each view in the model</span><br />
<span style="color: blue; font-weight: bold;">foreach</span> (Element e <span style="color: blue; font-weight: bold;">in</span> collection)<br />
{ <br />
<span style="color: teal; font-weight: bold;">try</span><br />
{ <br />
ViewSheet viewsheet = e <span style="color: darkcyan; font-weight: bold;">as</span> ViewSheet;<br />
<br />
<span style="color: green;">// only add sheets to list</span><br />
<span style="color: blue; font-weight: bold;">if</span> (viewsheet.IsPlaceholder == <span style="color: darkcyan; font-weight: bold;">false</span>)<br />
{<br />
sheetsToDWG.<span style="color: midnightblue; font-weight: bold;">Add</span>(e.Id);<br />
x += <span style="color: darkblue;">1</span>;<br />
}<br />
}<br />
<span style="color: teal; font-weight: bold;">catch</span><br />
{<br />
}<br />
}<br />
<br />
<span style="color: red;">string</span> path = <span style="color: blue;">""</span>;<br />
<span style="color: red;">string</span> file = <span style="color: blue;">""</span>;<br />
<br />
<span style="color: green;">// get the current date and time</span><br />
DateTime dtnow = DateTime.Now;<br />
<span style="color: red;">string</span> dt = <span style="color: red;">string</span>.<span style="color: midnightblue; font-weight: bold;">Format</span>(<span style="color: blue;">"{0:yyyyMMdd HHmm}"</span>, dtnow);<br />
<br />
<span style="color: blue; font-weight: bold;">if</span> (doc.PathName != <span style="color: blue;">""</span>)<br />
{<br />
<span style="color: green;">// use model path + date and time</span><br />
path = Path.<span style="color: midnightblue; font-weight: bold;">GetDirectoryName</span>(doc.PathName) + <span style="color: blue;">"\\"</span> + dt; <br />
}<br />
<span style="color: blue; font-weight: bold;">else</span><br />
{<br />
<span style="color: green;">// model has not been saved</span><br />
<span style="color: green;">// use C:\DWG_Export + date and time</span><br />
path = <span style="color: blue;">"C:\\DWG_Export\\"</span> + dt;<br />
file = <span style="color: blue;">"NONAME"</span>;<br />
}<br />
<br />
<span style="color: green;">// create folder</span><br />
Directory.<span style="color: midnightblue; font-weight: bold;">CreateDirectory</span>(path);<br />
<br />
<span style="color: green;">// export</span><br />
doc.<span style="color: midnightblue; font-weight: bold;">Export</span>(path, file, sheetsToDWG, dwgOptions);<br />
<br />
TaskDialog.<span style="color: midnightblue; font-weight: bold;">Show</span>(<span style="color: blue;">"Export Sheets to DWG"</span>, x + <span style="color: blue;">" sheets exported to:\n"</span> + path);<br />
}<br />
}Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com2tag:blogger.com,1999:blog-32577727.post-89344973490031719792013-10-17T17:27:00.002-07:002013-10-17T17:27:50.464-07:00Open Source Macros for RevitLast week several people on Twitter started a discussion of having a way to collect and share Revit macros for the Revit community. Luke <a href="http://whatrevitwants.blogspot.com.au/" target="_blank">(What Revit Wants)</a> suggested that we use an open source repository to collect and manage the macros. Eventually, Harry (<a href="http://boostyourbim.wordpress.com/" target="_blank">BoostYourBim</a>) setup a repository on BitBucket (<a href="https://bitbucket.org/BoostYourBIM/revit_api_public/overview">https://bitbucket.org/BoostYourBIM/revit_api_public/overview</a>).<br />
<br />
I have since added a few of my macros and plan to add all the existing ones. I will continue to contribute the macros I create for myself as well for <a href="http://losangelesrevitusersgroup.blogspot.com/" target="_blank">LARUG</a>. Follow Harry's instructions below to get the macros added to your Revit folder from BitBucket. Then whenever there are changes just pull them down to your computer and you will have all the macros in Revit ready to use.<br />
<br />
<span style="font-size: x-small;">Source:</span><br />
What Revit Wants: <a href="http://whatrevitwants.blogspot.com.au/2013/10/public-macro-repository-for-revit.html" target="_blank">Public Macro Repository for Revit</a><br />
BoostYourBIM: <a href="http://boostyourbim.wordpress.com/2013/10/11/a-pubic-git-repository-for-sharing-revit-macros-at-bitbucket/" target="_blank">A public Git repository for sharing Revit Macros at BitBucket </a><br />
<br />Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0tag:blogger.com,1999:blog-32577727.post-1261197560505851582013-10-10T21:09:00.000-07:002013-10-10T21:09:01.930-07:00Macros for Deleting all MEP Spaces and RoomsAnother task I do frequently is deleting all the spaces in my MEP model so that I can recreate them all based on the architect's rooms. Why delete them all? Sometimes its just easier to delete them all than to search out which rooms have been changed, deleted, or added. This macro prevents me from needing to delete the spaces from a schedule, since Revit doesn't delete allow deleting spaces from a plan view, only schedules.<br />
<br />
<span style="font-size: large;"><b>Delete All Spaces </b></span><br />
<br />
<b>Code</b><br />
<br />
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> DeleteAllSpaces()
{
<span style="color: green;">// setup uidoc and doc for accessing the Revit UI (uidoc) and the Model (doc)</span>
UIDocument uidoc = <span style="color: blue;">this</span>.ActiveUIDocument;
Document doc = uidoc.Document;
<span style="color: green;">// get all elements in the model</span>
FilteredElementCollector collector = <span style="color: blue;">new</span> FilteredElementCollector(doc);
<span style="color: green;">// filter out everything but spaces</span>
ICollection<Element> collection = collector.OfClass(<span style="color: blue;">typeof</span>(SpatialElement)).OfCategory(BuiltInCategory.OST_MEPSpaces).ToElements();
<span style="color: green;">// create and start a new transaction</span>
<span style="color: blue;">using</span>(Transaction t = <span style="color: blue;">new</span> Transaction(doc, <span style="color: #a31515;">"Delete All Spaces"</span>))
{
t.Start();
<span style="color: green;">// add a counter to count the spaces deleted</span>
<span style="color: blue;">int</span> x = 0;
<span style="color: green;">// loop through each space in the model</span>
<span style="color: blue;">foreach</span> (Element e <span style="color: blue;">in</span> collection)
{
<span style="color: blue;">try</span>
{
<span style="color: green;">// delete the space and increment counter by 1</span>
doc.Delete(e);
x += 1;
}
<span style="color: blue;">catch</span>(Exception ex)
{
}
}
<span style="color: green;">// finalize the transaction</span>
t.Commit();
<span style="color: green;">// show a dialog with the number of spaces deleted</span>
TaskDialog.Show(<span style="color: #a31515;">"DeleteSpaces"</span>, <span style="color: #a31515;">"Spaces Deleted: "</span> + x.ToString());
}
}</code></pre>
<br />
<span style="font-size: large;"><b>Delete All Rooms</b></span><br />
After showing this macro at LARUG, people asked if I could do the same for deleting all rooms. So here is a modified version.<br />
<br />
<b>Code</b><br />
<br />
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> DeleteAllRooms()
{
<span style="color: green;">// setup uidoc and doc for accessing the Revit UI (uidoc) and the Model (doc)</span>
UIDocument uidoc = <span style="color: blue;">this</span>.ActiveUIDocument;
Document doc = uidoc.Document;
<span style="color: green;">// get all elements in the model</span>
FilteredElementCollector collector = <span style="color: blue;">new</span> FilteredElementCollector(doc);
<span style="color: green;">// filter out everything but rooms</span>
ICollection<Element> collection = collector.OfClass(<span style="color: blue;">typeof</span>(SpatialElement)).OfCategory(BuiltInCategory.OST_Rooms).ToElements();
<span style="color: green;">// create and start a new transaction</span>
<span style="color: blue;">using</span>(Transaction t = <span style="color: blue;">new</span> Transaction(doc, <span style="color: #a31515;">"Delete All Rooms"</span>))
{
t.Start();
<span style="color: green;">// add a counter to count the rooms deleted</span>
<span style="color: blue;">int</span> x = 0;
<span style="color: green;">// loop through each room in the model</span>
<span style="color: blue;">foreach</span> (Element e <span style="color: blue;">in</span> collection)
{
<span style="color: blue;">try</span>
{
<span style="color: green;">// delete the room and increment counter by 1</span>
doc.Delete(e);
x += 1;
}
<span style="color: blue;">catch</span>(Exception ex)
{
}
}
<span style="color: green;">// finalize the transaction</span>
t.Commit();
<span style="color: green;">// show a dialog with the number of rooms deleted</span>
TaskDialog.Show(<span style="color: #a31515;">"DeleteRooms"</span>, <span style="color: #a31515;">"Rooms Deleted: "</span> + x.ToString());
}
}</code></pre>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com1tag:blogger.com,1999:blog-32577727.post-38377257408586484382013-10-07T13:50:00.001-07:002013-10-07T13:50:10.237-07:00Macros for Deleting Views and SheetsThese 3 macros were created to solve a task that I do frequently, clean models from other companies. As an MEP firm, we receive several models per project from the architects, structural, and others. We also use Revit Server to enable our teams to work from any office on any project. So in order to reduce time and space, we clean out the models we receive by deleting views, legends, schedules, and sheets. Then we purge and the models range from 30-60% smaller in size. Depending on the source of the model we may or may not delete the sheets and typically for arch models we keep the floor and ceiling plans for linking.<br />
<br />
<span style="background-color: red;"><span style="color: white;">Caution: DO NOT run these in your model unless you want to delete views and sheets </span></span><br />
<br />
<br />
<span style="font-size: large;"><b>Delete All Sheets And Views</b></span><u><span style="font-size: large;"><b> </b></span></u><br />
The first macro will delete all views and all sheets except for the currently open view or sheet. This is the ultimate cleaner for models that you only want the model and nothing else.<br />
<br />
<b>Code: </b><br />
<br />
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> DeleteAllSheetsAndViews()
{
<span style="color: green;">// setup uidoc and doc for accessing the Revit UI (uidoc) and the Model (doc)</span>
UIDocument uidoc = <span style="color: blue;">this</span>.ActiveUIDocument;
Document doc = uidoc.Document;
<span style="color: green;">// get all the elements in the model database</span>
FilteredElementCollector collector = <span style="color: blue;">new</span> FilteredElementCollector(doc);
<span style="color: green;">// filter out all elements except Views</span>
ICollection<Element> collection = collector.OfClass(<span style="color: blue;">typeof</span>(View)).ToElements();
<span style="color: green;">// create a transaction</span>
<span style="color: blue;">using</span>(Transaction t = <span style="color: blue;">new</span> Transaction(doc, <span style="color: #a31515;">"Delete All Sheets and Views"</span>))
{
<span style="color: green;">// start the transaction</span>
t.Start();
<span style="color: green;">// add a counter to count the views/sheets deleted</span>
<span style="color: blue;">int</span> x = 0;
<span style="color: green;">// loop through each view in the model</span>
<span style="color: blue;">foreach</span> (Element e <span style="color: blue;">in</span> collection)
{
<span style="color: blue;">try</span>
{
View view = e <span style="color: blue;">as</span> View;
<span style="color: green;">// all views/sheets are deleted and increment counter by 1</span>
doc.Delete(e);
x += 1;
}
<span style="color: blue;">catch</span>(Exception ex)
{
<span style="color: green;">// uncomment below to show error messages</span>
<span style="color: green;">//View view = e as View;</span>
<span style="color: green;">//TaskDialog.Show("Error", e.Name + "\n" + "\n" + ex.Message);</span>
<span style="color: green;">//TaskDialog.Show("Error", ex.Message);</span>
}
}
<span style="color: green;">// finalize the transaction</span>
t.Commit();
<span style="color: green;">// show message with number of views/sheets deleted</span>
TaskDialog.Show(<span style="color: #a31515;">"DeleteAllSheetsViews"</span>, <span style="color: #a31515;">"Views & Sheets Deleted: "</span> + x.ToString());
}
}</code></pre>
<br />
<br />
<span style="font-size: large;"><b>Delete Sheets And Views</b></span> <i>(except floor & ceiling plans)</i><br />
The second macro will delete all sheets and all views except for floor and ceiling plans. This is typically the macro I run on arch models towards the end of a project when we no longer to look through their sheets.<br />
<br />
<b>Code:</b><br />
<br />
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> DeleteSheetsAndViews()
{
<span style="color: green;">// setup uidoc and doc for accessing the Revit UI (uidoc) and the Model (doc)</span>
UIDocument uidoc = <span style="color: blue;">this</span>.ActiveUIDocument;
Document doc = uidoc.Document;
<span style="color: green;">// get all the elements in the model database</span>
FilteredElementCollector collector = <span style="color: blue;">new</span> FilteredElementCollector(doc);
<span style="color: green;">// filter out all elements except Views</span>
ICollection<Element> collection = collector.OfClass(<span style="color: blue;">typeof</span>(View)).ToElements();
<span style="color: green;">// create a transaction</span>
<span style="color: blue;">using</span>(Transaction t = <span style="color: blue;">new</span> Transaction(doc, <span style="color: #a31515;">"Delete Sheets and Views"</span>))
{
<span style="color: green;">// start the transaction</span>
t.Start();
<span style="color: green;">// add a counter to count the views/sheets deleted</span>
<span style="color: blue;">int</span> x = 0;
<span style="color: green;">// loop through each view in the model</span>
<span style="color: blue;">foreach</span> (Element e <span style="color: blue;">in</span> collection)
{
<span style="color: blue;">try</span>
{
View view = e <span style="color: blue;">as</span> View;
<span style="color: green;">// determine what type of view it is</span>
<span style="color: blue;">switch</span>(view.ViewType)
{
<span style="color: green;">// if view is a floor plan, don't delete</span>
<span style="color: blue;">case</span> ViewType.FloorPlan:
<span style="color: blue;">break</span>;
<span style="color: green;">// if view is a ceiling plan, don't delete</span>
<span style="color: blue;">case</span> ViewType.CeilingPlan:
<span style="color: blue;">break</span>;
<span style="color: green;">// all other views/sheets can be deleted and increment counter by 1</span>
<span style="color: blue;">default</span>:
doc.Delete(e);
x += 1;
<span style="color: blue;">break</span>;
}
}
<span style="color: blue;">catch</span>(Exception ex)
{
<span style="color: green;">// uncomment below to show error messages</span>
<span style="color: green;">//View view = e as View;</span>
<span style="color: green;">//TaskDialog.Show("Error", e.Name + "\n" + "\n" + ex.Message);</span>
<span style="color: green;">//TaskDialog.Show("Error", ex.Message);</span>
}
}
<span style="color: green;">// finalize the transaction</span>
t.Commit();
<span style="color: green;">// show message with number of views/sheets deleted</span>
TaskDialog.Show(<span style="color: #a31515;">"DeleteSheetsViews"</span>, <span style="color: #a31515;">"Views & Sheets Deleted: "</span> + x.ToString());
}
}</code></pre>
<br />
<br />
<span style="font-size: large;"><b>Delete Views</b></span> <i>(except floor and ceiling plans)</i><br />
The last macro will delete all views except for floor and ceiling plans. It will also not delete the sheets. I use this macro on arch models from the beginning of a project through mid CDs. It allows people on the project to review the arch plans sheets by opening their model.<br />
<br />
<b>Code:</b><br />
<br />
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="color: blue;">public</span> <span style="color: blue;">void</span> DeleteViews()
{
<span style="color: green;">// setup uidoc and doc for accessing the Revit UI (uidoc) and the Model (doc)</span>
UIDocument uidoc = <span style="color: blue;">this</span>.ActiveUIDocument;
Document doc = uidoc.Document;
<span style="color: green;">// get all the elements in the model database</span>
FilteredElementCollector collector = <span style="color: blue;">new</span> FilteredElementCollector(doc);
<span style="color: green;">// filter out all elements except Views</span>
ICollection<Element> collection = collector.OfClass(<span style="color: blue;">typeof</span>(View)).ToElements();
<span style="color: green;">// create a transaction</span>
<span style="color: blue;">using</span>(Transaction t = <span style="color: blue;">new</span> Transaction(doc, <span style="color: #a31515;">"Delete Views"</span>))
{
<span style="color: green;">// start the transaction</span>
t.Start();
<span style="color: green;">// add a counter to count the views deleted</span>
<span style="color: blue;">int</span> x = 0;
<span style="color: green;">// loop through each view in the model</span>
<span style="color: blue;">foreach</span> (Element e <span style="color: blue;">in</span> collection)
{
<span style="color: blue;">try</span>
{
View view = e <span style="color: blue;">as</span> View;
<span style="color: green;">// determine what type of view it is</span>
<span style="color: blue;">switch</span>(view.ViewType)
{
<span style="color: green;">// if view is a floor plan, don't delete</span>
<span style="color: blue;">case</span> ViewType.FloorPlan:
<span style="color: blue;">break</span>;
<span style="color: green;">// if view is a ceiling plan, don't delete</span>
<span style="color: blue;">case</span> ViewType.CeilingPlan:
<span style="color: blue;">break</span>;
<span style="color: green;">// if view is a sheet, don't delete</span>
<span style="color: blue;">case</span> ViewType.DrawingSheet:
<span style="color: blue;">break</span>;
<span style="color: green;">// all other views can be deleted and increment counter by 1</span>
<span style="color: blue;">default</span>:
doc.Delete(e);
x += 1;
<span style="color: blue;">break</span>;
}
}
<span style="color: blue;">catch</span>(Exception ex)
{
<span style="color: green;">// uncomment below to show error messages</span>
<span style="color: green;">//View view = e as View;</span>
<span style="color: green;">//TaskDialog.Show("Error", e.Name + "\n" + "\n" + ex.Message);</span>
<span style="color: green;">//TaskDialog.Show("Error", ex.Message);</span>
}
}
<span style="color: green;">// finalize the transaction</span>
t.Commit();
<span style="color: green;">// show message with number of views/sheets deleted</span>
TaskDialog.Show(<span style="color: #a31515;">"DeleteViews"</span>, <span style="color: #a31515;">"Views Deleted: "</span> + x.ToString());
}
}</code></pre>
<pre style="background-color: white; margin: 0em; overflow: auto;"><code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"> </code></pre>
<div style="background-color: white; margin: 0em; overflow: auto;">
<br /></div>
<div style="background-color: white; margin: 0em; overflow: auto;">
<code style="color: black; font-family: Consolas,"Courier New",Courier,Monospace; font-size: 10pt;"><span style="font-family: inherit; font-size: small;">If you have any questions about any of these macros, please leave a comment and I will try to assist.</span></code></div>
Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com9tag:blogger.com,1999:blog-32577727.post-15653784483705487902013-09-30T13:40:00.000-07:002013-10-10T21:22:36.646-07:00Creating Macros (LARUG Sept 2013)At the LARUG Sept 2013 meeting (video here: <a href="http://losangelesrevitusersgroup.blogspot.com/2013/09/larug-september-2013-macro-creation-in.html" target="_blank">http://losangelesrevitusersgroup.blogspot.com/2013/09/larug-september-2013-macro-creation-in.html</a>) I presented on Revit Macros. As promised I would do a follow up of the process, links to tools, and the macros themselves. In this post I will give you everything to download and I will follow up with separate posts about each macro over the next few days.<br />
<br />
Here are the downloads and links:<br />
<br />
<b><u>Revit Software Development kits</u></b><br />
<ul>
<li><a href="http://images.autodesk.com/adsk/files/revit2013sdk0.exe" target="_blank">Revit 2013 SDK</a></li>
<li><a href="http://images.autodesk.com/adsk/files/Revit2014SDK_RTM0.exe" target="_blank">Revit 2014 SDK</a></li>
</ul>
<u><b>Revit Development Blogs</b></u><br />
<ul>
<li><a href="http://thebuildingcoder.typepad.com/" target="_blank">The Building Coder</a></li>
<li><a href="http://boostyourbim.wordpress.com/" target="_blank">Boost Your BIM</a></li>
<li><a href="http://www.revitforum.org/third-party-add-ins-api-r-d/" target="_blank">RevitForum.org API sub-forum</a> </li>
<li><a href="http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975" target="_blank">Autodesk Developer Network</a></li>
<li><a href="http://lmgtfy.com/?q=revit+macros" target="_blank">LMGTFY Revit Macros</a></li>
<li><a href="http://lmgtfy.com/?q=revit+api" target="_blank">LMGTFY Revit API </a></li>
</ul>
<u><b>Revit Macro/Programming Tools</b></u><br />
<ul>
<li><a href="https://app.box.com/s/be1cndik9wcl5dnwkhls" target="_blank">Revit Lookup Addin</a> (2013)</li>
<li><a href="https://app.box.com/s/nweeqdfsa6qlrnvllqd8" target="_blank">Revit Lookup Addin</a> (2014)</li>
<li><a href="http://notepad-plus-plus.org/" target="_blank">notepad++ </a></li>
</ul>
<u><b>Macros (Individual posts to follow)</b></u><br />
<i>* Disclaimer: I am not an expert in programming, so the macros below may or may not work and I hold no responsibility to any problems they may cause your projects.</i><br />
<i>* Disclaimer #2: Fill free to use and edit these macros, but please give credit if you republish them.</i><br />
<ul>
<li>CreateMEPViews</li>
<li>DeleteAllRooms (<a href="http://revitcoaster.blogspot.com/2013/10/macros-for-deleting-all-mep-spaces-and.html">Blog Post</a>)</li>
<li>DeleteAllSpaces (<a href="http://revitcoaster.blogspot.com/2013/10/macros-for-deleting-all-mep-spaces-and.html">Blog Post</a>)</li>
<li>DeleteOneRoom</li>
<li>DeleteOneSpace</li>
<li>DeleteSheetsAndViews (<a href="http://revitcoaster.blogspot.com/2013/10/macros-for-deleting-views-and-sheets.html">Blog Post</a>)</li>
<li>DeleteViews (<a href="http://revitcoaster.blogspot.com/2013/10/macros-for-deleting-views-and-sheets.html">Blog Post</a>)</li>
</ul>
<ul>
<li><a href="https://app.box.com/s/w8pt86htnyu4nrjhn6pv" target="_blank">Download Here </a></li>
</ul>
<br />
<i>* I included install instructions in the Revit Lookup zip files and the LARUG zip file. If you have questions on how to install these, leave a comment below.</i>Anonymoushttp://www.blogger.com/profile/04956053365614954917noreply@blogger.com0