|
Revit Formulas PDF Summary Today we’re going to talk about formulas in Revit. According to the RAE, a formula is defined as "the equation or rule that relates mathematical objects or quantities." In Revit, these "mathematical objects or quantities" come in the form of parameters. This means that formulas help us relate parameters either to each other or to numerical values. These values can exist in as many different unit types as Revit parameters themselves. We've already discussed Revit parameters extensively in this parameters article on the blog. The second part of the definition refers to the relationship between these objects. This relationship is expressed through operations, which can be mathematical, conditional, or trigonometric. Relationships in Revit Formulas PDFBelow, we provide a summary sheet with the relationships that can be used in Revit formulas. If you’re interested, you can download this summary in PDF format here.
Download this sheet by clicking on the image
Conditional Formulas (IF) in Revit Revit formulas allow us to condition values using the IF function, which helps automate decisions within families. We can set up logical rules so that certain parameters change based on other values, providing greater flexibility and control in our models. The basic structure of a conditional formula in Revit is: IF(condition, value_if_true, value_if_false) 📌 Simple IF Condition ExampleIf we want a parameter called DoorHeight to have a minimum of 2 meters, we can use: IF(DoorHeight < 2000mm, 2000mm, DoorHeight) IF Condition with Text ParametersText parameters can also be used in conditional formulas, but must be written inside quotation marks "". 📌 Simple IF Example with Text ParametersIf we want a Classification parameter to change based on the area of a space, we use: IF(Area > 50m², "Large", "Small") 📌 Text Example in an IF Statement IF(A<B,"TEXT1","TEXT2") = If A is less than B, the conditional value will be "TEXT1"; otherwise, it will be "TEXT2". Yes/No parameters work differently because they don’t require IF statements. The condition itself determines whether the value is True (Yes) or False (No). 📌 For this reason, to modify the value of a Yes/No parameter using a condition, you only need to enter the condition directly—without using IF. The parameter's definition already includes the condition itself. If the condition is true, then the parameter will be checked (✔). Sometimes, these formulas are called visibility formulas because they can control whether an object appears in the model. However, keep in mind that a Yes/No parameter does not have to be strictly linked to visibility. All conditions must be true for the formula to return a positive value. IF(AND(A>B, C>D), E, F) = If A is greater than B **and** C is greater than D, the result is E; otherwise, it is F. Logical OR (OR)At least one condition must be true for the formula to return a positive value. IF(OR(A>B, C>D), E, F) = If A is greater than B **or** C is greater than D, the result is E; otherwise, it is F. Revit formulas have certain limitations, especially when we need to: Dynamo is a visual programming tool that helps overcome these limitations and enhance automation capabilities in Revit. Essential Dynamo Nodes for Parameter ManagementDynamo allows reading and writing parameters in Revit using two key nodes: Get Parameter Value By Name → Retrieves the value of a specific parameter from a set of elements. Set Parameter Value By Name → Assigns a value to a specific parameter in multiple elements. 📌 Example: Automatically Calculating Room Occupancy Using Dynamo Use Get Parameter Value By Name to extract the area of each room. Occupancy = Area / 10 m² Use Set Parameter Value By Name to assign the result to the Room_Occupancy parameter. This way, if the room area changes, the occupancy updates automatically, eliminating the need to edit formulas manually in Revit. Conclusion: When to Use Revit Formulas vs. Dynamo?🔹 Use Revit formulas when... Working within a single family. Performing simple calculations without external references. Avoiding complex conditionals or cross-category dependencies. 🔹 Use Dynamo when... Modifying parameters in multiple elements at once. Connecting parameters across different categories or families. Needing advanced calculations, complex conditionals, or external references. If you’re new to Dynamo but want to learn more, download our "Dynamo Fundamentals Guide" here.
|


