Revit Content Development - Under the Hood

Updated: Aug 3, 2019

In drag racing, a well-tuned engine is one of the most important components to winning the race. The same is true for BIM content in the AEC industry; well-tuned, quality content is key to a successful project.

One of the most important factors in selecting a BIM content developer is that they have experience developing stable, efficient, parametric content. There is a delicate balance between the level of detail and model stability. When developing Revit content for our manufacturing clients, there are many times that we must think outside the box. We construct their Revit content in such a way that it helps the end-user make informed decisions about the products they are designing around. Some of our clients' products only come in certain sizes, or with certain options. Having content that allows the users to show the content in ways the manufacturer does not offer would be more harmful than helpful.

We attribute much of the success we have experienced to how much we have been blessed to learn from others. One thing I love about the AEC community is the willingness to share knowledge between colleagues. We all collectively grow by sharing our experiences and insight with others. In this post I will go through some of the parametric concepts I have had to work through. 

The Revit IF Statement

Revit uses a lot of the same programming language used in Excel, so if you know how to write formulas in Excel you are well on your way to successful formulas in Revit. The syntax for the formula is relatively straightforward; IF (<Condition>, <Result If True>, Result If False>). In simpler terms, if this condition is true, do this, if not then do that. The Condition and the Results are separated by commas. For example, let's say you really like 2 door cars but only kind of like 4 door cars. Below is an example of how you could write the formula.

In the example above I used two parameters, "How Many Cars I Want" and "How Many Doors Does It Have". In the formula you can see that I wrote, if the car has 2 doors, I want 3 of them; otherwise I only want one. If only it were that easy in real life.

The Nested IF Statement

Let's say I'm a little more picky about my vehicle and concerned with more than just how many doors it has. Many of you who know me personally know I am obsessed with Jeep Wranglers. Building on our previous example, let's take in to account the model of the vehicle; because let's face it; if it's not a Wrangler you do not have an off-road capable vehicle, you just have an SUV. See the example below:

This time I addressed some really important issues, is it a Jeep Wrangler, How Many Doors Does It Have, and Is it Virginia Tech Orange? After all, who doesn't love the Hokies? GO HOKIES! So, you may notice I employed a couple new tactics with the formula this time. First, I used a Not statement to create a switch. Often times you are dealing with two options, it's either this or it's that. By using the Not statement as shown above, I don't need to uncheck one and check the other. I simply uncheck the one option which in turn flips on the other option, really simple and very effective. The second thing I added in was the And operator, effectively it becomes if this and this and this are all true, then do this, otherwise do that. Note that I only needed one And, and that the conditions are separated by commas. I have no limit to the number of conditions I can enclose in an And statement. Right now an English professor's mind is exploding somewhere. Another key point to pick up in the example is that the And statement is closed with parenthesis before continuing with the results. If you can break down Revit formulas to its simplest form such as this you will be able to address just about any condition you face.

Recently we were developing Revit content for one of our longest standing HVAC clients and working with some security air terminals. One of the products in the group is only available in certain sizes increasing in 3-inch increments, so for example, 12", 15" and so on. We have developed a lot of air terminals that were only available in even and odd sizes but nothing like this. While working through the bones of the content we thought about how important it would be for the end-user to understand this. I mean of course it was called out on the manufacturer's spec sheet, but let's be honest, many times people don't read them. We didn't want the end-user to be able change the air terminal to a size that isn't offered. So, what did we do?

As I mentioned above, Revit largely mirrors the programming language used in Excel. One of the really powerful formula operators is Round. You can simply use Round which will round to the nearest whole number, or you can use Roundup and Rounddown. We had to employ the Round operator in combination with a rounding trick we know. We divided the dimensional value entered in the Nominal Air Terminal Size parameter by 3 and then multiplied it by 3. Because the dimension was being divided and multiplied by 3, the result was being cubed. To resolve that issue, we finished the formula by multiplying it by 1, effectively neutralizing the cubed result. This little trick ensures that the result is a dimensional value divisible by 3. Below is how we wrote the formula:

=(round(Nominal Air Terminal Size/3)*3)*1)

One last trick we will share in this post is what we call End-User Feedback. Referring back to the air terminal example above, if the user entered a dimension of 10" the Revit content would automatically adjust the content to a dimension divisible by 3, so it would be rounded to 9". The end-user would see that the content has adjusted to 9" but they wouldn't know why. They could end up calling our client complaining that the content doesn't work, even though it does. Situations such as this call for our Revit content to provide some feedback to the end-user to save everyone time, especially our client. The solution is relatively simple, use a couple parameters and an IF statement. One parameter we named "Size Feedback" and made it a Text parameter. The other we made a Yes/No parameter with an IF statement in the formula. If you have done any content development, you may be saying to yourself "you can't put an IF statement in the formula for a Yes/No parameter". Well sure you can, you just have to get creative. Write the formula in such a way that it checks itself for truth. Here's the formula example:

Air Terminal Size Check = If(Nominal Air Terminal Size=Width,1=1,1=0)

One thing to remember in the formula above is that the Width parameter is pointing to the rounding parameter we explained above, so what we are doing is checking the user's entry up against the rounded result of the width parameter. If the values match it means the user entered a valid size, if they are different it means the value had to be rounded and we need to tell the user why. In the simplest terms, the example above says, is the user's entry valid? If so, 1=1 and the box would be checked, if not the box would be unchecked. The Size Feedback parameter would have a relatively simple formula as well, remember that it is a text parameter, the formula is below along with some images showing how it looks in the project environment.

if(Air Terminal Size Check, "Valid Size", Sizes In 3 Inch Increments")

As you can hopefully see, we are passionate about Revit content development. It is one thing to do some quick modeling, constrain the geometry to some reference planes and call it good. It is a whole other thing to develop Revit content, make it efficient, useful, and easy to understand. We take a lot of pride in the content we provide to our manufacturing clients as well as our architectural and engineering clients. Whether your firm needs full-blown Revit implementation services, or you just need some content for projects from time to time, we can help. If you represent a manufacturer that is considering heading down the BIM road, we applaud you for moving in the right direction. We would welcome the opportunity to help get you there. Give us a call and we can have an honest conversation about your needs and help you set realistic goals.

© 2016 by BIM Consulting Services ✪ Saint Johns, Florida ✪ Tel: 833-Go-Revit ✪