Conditional Statements – pushing the limits of Revit

So last week I was tasked with create a duct mounted adjustable pitch axial flow fan.  I was told there were 672 variations permissable and provided a spreadsheet of sizes and a diagram explaining how it matched up.

Adjustable Pitch Axial Flow Fan

Sure I could have just generated a type catalog of the sizes, but then what’s to stop the end user going into the type and instance parameters and changing values, which may created unavailable combinations or worse, break the family because of invalid sizing combinations…

Solution: Conditional Statements

For those who have attended some of my RTC presentations you may have your own copy of my nested If Statement generator which I created in Excel as I have given it away to some attendees.  Below is an image of what it is.  Its not that complicated, just some concatenate formulas nested into each other…

Excel Revit IF Statement Generator

The big advantage is it doesn’t matter how many you nest into each other, just grab the bottom line and paste into Revit.

Revit Limitations

To tell the truth the previous maximum IF Statements I’ve tried is around 200, this time there were nearly 700, and many different parameters each requiring a formula of this complexity.   What I found was Revit would crash at around 580 conditional statements in a single formula…  Surely Autodesk should know someone would try and do this, lol!

So how to get around this limitation, my first thought was to try and use “And” and “OR” conditions to try and reduce the number of required conditions.  However, this was going to be extremely tedious and there would still be 168+…  So then I decided to simply split across a couple of parameters.  EG: I had 500 conditions in one parameter then linked to a different parameter with the remaining conditions.  SOLVED!

Revit Formulas

I did note a large performance hit when changing parameters in the family editor.  Changing any values would take 5-15 seconds.  However, testing in a project and the changes are instant!  So not sure why performance is fine in a project.

I still created a type catalog of all 672 types to make it quick and easily to select the appropriate model.

I hope someone finds this useful!

This entry was posted in Services and tagged , , , . Bookmark the permalink.

3 Responses to Conditional Statements – pushing the limits of Revit