Clicky Web Analytics
presentation
documentation
creation
automation
bim after dark live

Thursday, January 27, 2011

Revit Tutorial - Curtain Wall Door (If/Then Statement)

Hunter emailed me the other day with some interesting family creation questions. Through emails we worked through an issue he was having with an “if/then” statement. I cannot take a ton of credit for the solution because Hunter discovered it on his own… But, I guess I sort of pointed him in the right direction and gave him some ideas of resources to search. Well, I asked Hunter to make a quick write up of the issue and solution. Below is his write up.


Revit Tutorial – IF/THEN Statement

I was working on an aluminum door for a project and I wanted the visibility of the center mullion to be controllable. I also wanted the center mullion size to be controlled by an instance parameter. I had first thought of just using a graphic yes/no parameter to change the visibility. But then thought what would happen if someone typed 0” for the center mullion size. The center mullion is created with an extrusion and if you use “0” as a dimension for an extrusion the family stops working and there are errors to check through.




Now came the tough part; I could turn off the visibility of the center mullion by using the formula {center horiz mullion > 0”} (when the center horizontal mullion is less than 0” turn it off) simple enough, but the 0” was causing the family to break.

So, I created 3 parameters;

• -“center horiz mullion” and set it to 6” as the default.

• -I created a graphic yes/no parameter for the center mullion and assigned “mullion” to it.

• -I then dimensioned the reference planes for the center mullion and assigned the “formula” parameter to them.




I had to find a way to use 0” but not break the family. Solution: an IF statement. IF(center horiz mullion < 0' 0 1/2", 0' 0 1/2", center horiz mullion). IF this, do this, else do that. IF the center horizontal mullion is less than 0’ 0 1/2" make it 0’ 0 1/2" and if it’s not less than 0’ 0 1/2" make it what the user wants it to be. FYI – I used 0’ 0 1/2" because if you try and use 0.01” the family breaks because the extrusion can’t be smaller than a particular size, I don’t know what that is but 0’ 0 1/2" works.



Remember parameter names are case sensitive. Do not use numbers for parameter names. Avoid using a dash or a hyphen, Revit may think you are trying to subtract.

Thank you to Hunter for the great email conversation and post. Look forward to exploring more family creation with you. This has inspired me to continue with my family creation tutorial series… Stay tuned..


Contact him at: HunterVanLeeuwen@dsraenvision.ca