Understand errors in units and numerical constants in formulas that are used to calculate dimensions.
Formulas and Units
- Numbers with units
- Boolean values (yes/no)
- Strings (text)
Formulas can operate on the following types of data:
When using formulas to calculate dimensions, an error in units typically results when you do not follow the rules required by an operation.
Examples
- For addition, both inputs and the result must have the same numerical unit type.
- Multiplication can support any numerical unit type for the inputs (not necessarily the same type). However, the result must be the product of the input units. For example: length * area = volume.
- sin( ) requires the input to be an angle, and the output to be a number with no unit type.
- if( ) requires the first argument to be Boolean. The other arguments and the result can be of any data type (numeric, Boolean, text), but they must all be the same data type.
Revit is working with the base physical dimension (Time, Length, Mass, Temperature, and so on). Dimensional analysis is independent of the unit used to represent or measure the base physical dimension (seconds, meters, kg, degrees Celsius, and so on).
Formulas and Constants
Another source of dimensional errors is the interpretation of numerical constants in formulas.
When a formula includes a parameter name or a numerical constant with explicit units (such as 5 kg), Revit knows the units of the expression with certainty. However, the software also allows you to enter a number without a unit (such as 5). In this case, Revit guesses the units of the number to make the units in the formula agree. This issue is the reason for the common trick of adding *1 or /1 to a formula.
The best practice is to specify units for each constant in the formula.
Examples
- You want the result of a formula to be a length. You enter 3 * 3. When you edit the formula again, you can see that Revit has guessed that one of those numbers is a length by the notation 3' * 3.
- You want the result of a formula to be a length. When you enter 3 * 3 kg/3, you get an inconsistent units error. However, 3' * 3 kg/3 gives the desired result because Revit guesses that the last constant is intended to be kg. This formula also mixes units (imperial and metric), so when you edit the formula, you can see that Revit changed it to project units: 3' * 6.614 lbm/3 lbm.
Units for Constants
The following units can be used in formulas for constants. This list is not exhaustive, but it includes the most common unit types.
Unit | Symbols |
---|---|
Linear feet | ' or LF |
Inches | " |
Square feet | SF or ft2 or ft^2 |
Cubic feet | CF or ft3 or ft^3 |
Seconds (time) | s |
Hours | h |
Pounds mass | lbm |
Pounds force | lbf |
Kips | kip |
Radians | rad |
Fahrenheit degrees | °F |
Decimal degrees | ° |
Kips per square inch | ksi or kip/in2 |
Pounds per square inch | psi or lbf/in2 or psig or psia |
Unit | Symbols |
---|---|
Millimeters | mm |
Centimeters | cm |
Decimeters | dm |
Meters | m |
Kilograms | kg |
Celsius degrees | °C |
Kelvin | K |
Newtons | N |
Kilonewtons | kN |
Meganewtons | MN |
Pascals | Pa |
Megapascals | MPa |