You are on page 1of 4

REVIT FAMILIES CHEAT SHEET

Formula Syntax, Geometric Relationships, & Tricks

+ Addition Adds values together if(x,y,z) Conditional statement Gives different values based on whether
- Subtraction Subtracts one value from another a given condition is true or false:
If(condition, result if condition is true,
* Multiplication Multiplies values together result if condition is false). When you
/ Division Divides one value from another have a yes/no parameter, the true and
false results are implied. You do not use
^ Exponentiation Raises a value to another
the IF(x,y,z) formula, you simply write
sqrt(x) Square Root Finds the square root of a value the condition. If the condition is true,
sin(x) Sine Finds the sine of an angle the box is checked, if false, the box is
unchecked
cos(x) Cosine Finds the cosine of an angle
and(a,b,c,…) And statement Two or more conditions must all be
tan(x) Tangent Finds the tangent of an angle
true: AND(condition 1, condition 2,
asin(x) Arcsine Finds the inverse sine of a value condition3, etc.)
acos(x) Arccosine Finds the inverse cosine of a value or(a,b,c,…) Or statement One of two or more conditions must be
atan(x) Arctangent Finds the inverse tangent of a value true: OR(condition 1, condition 2,
condition3, etc.)
pi() π Pi Mathematical constant π
not(a,b,c,…) Not statement Two or more conditions must all be
exp(x) e Raised to an exponent Mathematical constant e raised to the x
false: NOT(condition 1, condition 2,
power
condition3, etc.)
ln(x) Natural Logarithm Logarithm of a number to the base
= Equal Compares equal values
value of mathematical constant e
< Less than Compares value which is less than
log(x) Logarithm The power to which a fixed number (the
another
base) must be raised to produce a given
number. A base of 10 is assumed > Greater than Compares value which is greater than
another
abs(x) Absolute value The magnitude of a real number without
regard to its sign not(a>b) Less than or equal Compares value which is less than or
equal to another. Revit does not have a
round(x) Round Rounds a value to the nearest whole
≤ function, so this is how to accomplish
number
the same logic
roundup(x) Round up Rounds a value to a whole number
not(a<b) Greater than or equal Compares value which is greater than or
grater than or equal to the value
equal to another. Revit does not have a
rounddown(x) Round down Rounds a value to a whole number less ≥ function, so this is how to accomplish
than or equal to the value the same logic

2
REVIT FAMILIES CHEAT SHEET
Formula Syntax, Geometric Relationships, & Tricks

This same logic can be used to return the greatest of more than three variables, but
with each variable you can see how it will get more complicated.
Returning a string
You can use if statements to return a text value (string) based on a condition, simply
us quotation marks around the text to indicate a string:
Text Parameter = if(Area<100, “Non-Rentable”, “Rentable”)
Circle (x-h)^2+(y-k)^2=r^2 Ellipse ((x-h)^2/a^2)+((y-k)^2/b^2)=1 Restrict user inputs to a range
Circular Area pi()*r^2 Elliptical Area pi()*a*b
Sometimes you want to build in logic to keep a user from breaking the model by
Circumference 2*pi()*r Triangular Area (b*h)/2
entering in a value that does not make sense or that may prevent your family from
working properly:
Useful Tricks Given:
Nesting if formulas a = Minimum acceptable value
Placing one or more if statements into another if statement allows you to have more b = Maximum acceptable value
than one condition. Value = Parameter set by end user but not assigned as a constraint
ActualValue = Restricted parameter which is assigned as a constraint
For example, you want to calculate total rent generated by an area, but different
square footage ranges have different rental rates: Then:
Given: ActualValue = if (Value < a, a, if (Value > b, b, Value))
ft2
0-49 rents at $25/ft2 Round x to the nearest multiple of y
50-149 ft2 rents at $22/ft2
Sometimes it is not enough to round to the nearest whole number. If you would like
150 ft2 or more rents at $20/ft2
to round to the nearest multiple of a number use the round function with a little
Then: math:
TotalRent = if(Area < 50, Area/1 * 25, if(Area <150, Area/1 * 22, Area/1 * 20)) = (round(x/y))*y
*Notice that the Area is divided by 1. This is to neutralize the ft2 unit. If this is not Round 23 to nearest multiple of 5
done, you will get an error. See the Inconsistent Units Error section for more details.
= (round(23/5)) * 5 = 25
Returning the greatest of three variables
Locking a yes/no parameter
Given the following three variables, they could be lengths, numbers, areas, etc.:
Sometimes you want to lock a yes/no parameter so that the end user can’t change it:
a, b, & c
Lock Checked = 1 < 2
Then: Lock Unchecked = 1 > 2
Greatest = if(if(a > b, a, b) > c, if(a > b, a, b), c)

3
REVIT FAMILIES CHEAT SHEET
Formula Syntax, Geometric Relationships, & Tricks

In other situations, you may not have enough units. Say you have a length or area
Correcting Inconsistent Units Error parameter, and you are trying to define it by multiplying two or more number
parameters together, which do not have units, you will also get the Inconsistent Units
This error occurs for two main reasons:
Error:
Reason 1 – The equation you entered does not yield a value in the same units as the
Length Param. = Number1 x Number2 = No Units Error
parameter type. In other words, you have not considered the units for all the variables
Length Param. = 10 x 20 = 200 Error
in your equation.
Area Param. = Number1 x Number2 = No Units Error
For example, recall that Length x Length = Area
Area Param. = 10 x 20 = 200 Error
This means that if you have a length parameter, and you are trying to define it by
In this type of situation, you must add the appropriate unit to one or more of your
multiplying two or more length parameters together, you will get the Inconsistent
parameters so that the equation yields the correct units for the parameter type. This is
Units Error:
often accomplished by multiplying parameters by 1:
Length Param. = Length1 x Length2 = Area Error
Length Param. = Number1 x Number2 x 1 = Length No Error
Length Param. = 10ft x 20ft = 200ft2 Error
Length Param. = 10 x 20 x 1ft = 200ft No Error
Length Param. = Length1 x Length2 x Length3 = Volume Error
Area Param. = Number1 x 1 x Number2 x 1 = Area No Error
Length Param. = 10ft x 20ft x 30ft = 6,000ft3 Error
Area Param. = 10 x 1ft x 20 x 1ft = 200ft2 No Error
It can also happen that your formula may contain parameters with differing units. In
Reason 2 – Part or all your equation is not appropriate for the parameter.
the case of calculating a total cost (a currency parameter) which you are trying to
define by multiplying a room area by a square foot cost, you will get the Inconsistent For example, you have a Yes/No parameter but you have not entered a condition
Units Error: statement. Maybe you have a Text parameter but your equation yields a number.
There are other possibilities, but you get the idea; something about your equation
Currency Param. = Area x Cost = Mixed Units Error
does not agree with the parameter’s logic.
Currency Param. = 250ft2 x $120 = $30,000ft2 Error
You can solve this error by simply checking your parameter type, and reviewing your
To correct these types of errors, you must remove the inappropriate units from one
equation for inappropriate variables, typos, or characters which do not belong given
of your parameters so that the equation yields the correct units for the parameter
the type of parameter.
type. This is often accomplished by dividing one or more of the parameters by 1:
Length Param. = Length1 x (Length2/1) = Length No Error
Length Param. = 10ft x (20ft/1ft) = 200ft No Error
Length Param. = Length1 x (Length2/1) x (Length3/1) = Length No Error
Length Param. = 10ft x (20ft/1ft) x (30ft/1ft) = 6,000ft No Error
Currency Param. = (Area/1) x Cost = Cost No Error
Currency Param. = (250ft2/1ft2) x $120 = $30,000 No Error

4
REVIT FAMILIES CHEAT SHEET
Formula Syntax, Geometric Relationships, & Tricks

Circular Segments Relationship Equation Lookup Chart


What you want to find
s c a r h d
ca (1/360)*pi()*a*c*(1/sin((pi()*a)/360)) (1/2)*c*(1/sin((pi()*a)/360)) (1/2)*c*(CSC((pi()*a)/360)-COT((pi()*a)/360)) (1/2)*c*(1/tan((pi()*a)/360))

cr 2*r*asin(c/(2*r)) (360/pi())*asin(c/(2*r)) r-(sqrt(r^2-(c^2/4))) (1/2)*r*sqrt(4-(c^2/r^2))

ch asin(c/(h+(c^2/(4*h))))*(h+(c^2/(4*h))) (360*asin((4*c*h)/(c^2+4*h^2)))/pi() (h/2)+(c^2/(8*h)) (sqrt((c^2-4*h^2)^2/(c^2+4*h^2)^2)*(c^2+4*h^2))/(8*h)


What you know

cd d*sqrt((c^2/d^2)+4)*atan(c/(2*d)) (360/pi())*atan(c/(2*d)) (1/2)*d*sqrt(c^2/d^2+4) sqrt(d^2+((1/2)*c)^2)-d

ar (a/180)*pi()*r 2*r*sin((pi()*a)/360) r*(1-cos((pi()*a)/360)) r*cos((pi()*a)/360)

ah -((pi()*a*h)/(180*(cos((pi()*a)/360)-1))) 2*(-(h/(cos((pi()*a)/360)-1)))*sin((pi()*a)/360) -(h/(cos((pi()*a)/360)-1)) -(h/(cos((pi()*a)/360)-1))-h

ad (1/180)*pi()*a*d*(1/cos((pi()*a)/360)) 2*d*tan((pi()*a)/360) d*(1/cos((pi()*a)/360)) d*((1/cos((pi()*a)/360))-1)

rh 2*r*acos(1-(h/r)) 2*sqrt(-h*(h-2*r)) (360/pi())*acos(1-(h/r)) r-h

rd 2*r*acos(1-(d/r)) 2*sqrt(r^2-d^2) (360/pi())*acos(d/r) r-d

hd 2*(d+h)*acos(d/(d+h)) 2*sqrt(h*(2*d+h)) (360*acos(d/(d+h)))/pi() h+d

Right Triangle Relationship Equation Lookup Chart


What you want to find
a b c A B
ab sqrt(a^2+b^2) atan(a/b) atan(b/a)
ac sqrt(c^2-a^2) asin(a/c) acos(a/c)
aA a/tan(A) a/sin(A) 90-A
What you know

aB a*tan(b) a/cos(B) 90-B


sqrt(c^2-
bc acos(b/c) asin(b/c)
b^2)
bA b*tan(A) b/cos(A) 90-A
bB b/tan(B) b/sin(B) 90-B
cA c*sin(A) c*cos(A) 90-A
Right Triangle Circular Segment
cB c*cos(B) c*sin(B) 90-B

You can download an excel version of these charts for easy copy and pasting here.

You might also like