Professional Documents
Culture Documents
Learning Objectives
At the end of this class, you will be able to:
Identify and describe the concepts behind lookup tables and explain how lookup tables benefit the
design process
Create custom families that reference lookup tables for automated design
Use formulas with lookup tables for accurate design
Explain how using lookup tables improves workflow
The first column is a reference column used to designate a name or reference for
what that row in the table defines. The column header for this column is always left
blank. The second column defines the lookup value, typically the nominal diameter
of the element. This column is a comparative column that Revit tries to match data
from the family to the data in this column. All remaining columns are lookup
columns, where Revit will retrieve values based on the lookup value data in the
family. If more than one lookup value is necessary, then as many columns as
needed are created, shifting the lookup columns over. So, if youre creating a tee
fitting that has three different nominal diameters, one for each connection, you
should have three lookup value columns to coincide these parameters.
Note: The lookup value(s) in the lookup table must correlate to a Size type
parameter (i.e. Duct Size, Pipe Size, etc.). lookup columns can be any type
that is numerical (i.e. Length, Integer, Volume, etc.).
In the Manage Lookup Tables dialog, click on the Import button. Browse to the
appropriate lookup table file and click OK.
Back in the Family Types dialog, we add a text parameter named Lookup Table
Name. (The text parameter can technically be named anything you want, but to
keep consistency with out of the box families and to simplify formulas, I recommend
keeping the standard name.) Then enter the name of the .csv file in the value of this
parameter.
Note: The Lookup Table Name value must match the .csv file name exactly
without the .csv extension, but it is not case-sensitive.
Once the Lookup Table Name parameter has been filled in with the appropriate .csv
file name, the lookup table can be used in formulas to reference the table for
values.
Using Formulas with the Lookup Table
A specific formula is used to reference the lookup table to acquire values:
In this case, the formula for finding the value of Fitting Outside Diameter reads
something like this: In Lookup Table Name (refers to parameter under Text where
you entered the .csv file name), look for a row in the lookup value column that
corresponds to the familys current value of Nominal Diameter and return the value
from column FOD in that row. If no match is found for Nominal Diameter in the
lookup value column, return a value equal to Nominal Diameter 1 + 1/8.
Notice that Nominal Diameter currently has a value of 1. If we look at our .csv file,
well see that ND, our lookup value, corresponds to Nominal Diameter in the Family
Types dialog. When ND is 1, FOD is 1.125, or 1 1/8. So our family will have a
Fitting Outside Diameter value of 1 1/8.
In this case, the formula for finding the value of Socket Bottom to Socket Bottom
Run reads something like this: In Lookup Table Name (refers to parameter under
Text where you entered the .csv file name), look for a match between Revits
Nominal Diameter 1 and Nominal Diameter 2 parameter values and the lookup
value columns in a single row within the lookup table. If a match is found Revit will
return the value found in that row for the column SBtSBR. If no match is found,
Revit will return a value equal to .03*Nominal Diameter 1 + 1.96*Nominal Diameter
2 + 125/256.
Notice that Nominal Diameter 1 currently has a value of 2 and Nominal Diameter 2
has a value of 1 1/4. If we look at our .csv file, well see our first lookup value,
called ND1, corresponds to Nominal Diameter 1 in the Family Types dialog and our
second lookup value, called ND2, corresponds to Nominal Diameter 2. When ND1 is
2 and ND2 is 1.25", SBtSBR is 3.0625, or 3 1/16".
We can define as many parameters as necessary using the lookup table, but
remember that the values are driven by the first column(s). The number of lookup
values in the formula should always be equal to the number of lookup value
columns in the .csv file. If a parameter is unrelated to the lookup value (typically the
nominal diameter), it shouldnt be part of the lookup table.
Heres another look at interpreting this complex relationship:
arent right for the situation you can always convert the .csv file to a type catalog
(Did I mention that lookup tables work with families that have type catalogs too?).
Tricking the System
Sometimes the parameter we want to use for the lookup value may not be a Size
type parameter, even though Revit requires that it be one for the formula to work
properly. So we have to get creative with our families. Since we know that lookup
tables will only function with numerically-based parameter types, we can use an
intermediate parameter to convert the information we want to use into a format
that will satisfy the limitations of the workflow.
In this example we want to use a lookup table to size a piece of equipment based on
the manufacturers specifications. To accomplish this, we will take all of the predetermined sizes that were populated into the types of this family and convert them
into a lookup table. Doing this locks down these sizes so that the user will be
unable to manipulate them in the project environment.
The lookup value for this family will be the capacity of the tank. We will use this
value because all of the other size parameters directly relate to this field. However,
this is where we hit a snag. The Capacity parameter is not a Size parameter it is
an Integer! According what we said earlier, we are unable to use parameters that
are not of the Size type as our lookup value.
This is where we trick the system. We can create a new parameter that is of a Size
type in order to convert this value to something we can use in a lookup table. In this
case, we make a parameter called Capacity Converter that is of the Duct Size type.
Then, back in the Family Types dialog, you can enter a simple formula to convert the
Integer value to a Size value (in inches).
Once this conversion is done we can use this parameter as the lookup value in our
lookup table. The resulting lookup table would look something like this, where our
lookup value CC relates to our Capacity Converter parameter in Revit. All of the
remaining columns in the lookup table will be lookup columns.
These lookup columns can then be used in Revit via the lookup table formula we
covered earlier. For example, you can make the H lookup column relate to the
Height parameter in Revit.
Then, you can continue this process for the remaining parameters in your family.
Once all of the parameters contain the appropriate lookup table formula, all that a
user has to do is change the value in the Capacity parameter to one of the
appropriate capacity values shown in the table, and all of the dimensions will
automatically update.
A Step Further: Allowing Custom User Input
The above example works great when you want to completely lock down a family,
but what if you want to also allow custom sizes from the user? We can accomplish
this by adding some additional parameters to the family.
First, we will create a Yes/No parameter for the user to specify if they want a custom
size. When checked, this parameter will completely override the lookup table.
Then, we will add additional parameters to our family for every parameter that is
being controlled by the lookup table. For example, the Height_Custom parameter
relates to the Height parameter that is being driven by the lookup table. The custom
parameters are sorted under the grouping of Construction rather than Dimensions
to group the custom parameters together rather than being mixed in with the
lookup table driven parameters.
10
Now, we need to make a change to the formula for each of the parameters being
controlled by the lookup table. We will do this so that when the user checks the
Custom check mark, the custom values control the geometry rather than the lookup
table values. In the example of the Height parameter, the formula will look
something like this:
Note: In this example, the Default if Not Found value for the lookup table
formula also tells Revit to use the custom values.
To translate this into English, if the Custom parameter is checked, use the value
from the custom parameter, otherwise use the size_lookup formula.
Continue modifying the formulas for the remaining parameters. You should now
have a family that allows for custom input or for input based on the lookup table.
11
Now that the lookup table has been imported and associated, we can reference the
lookup table to provide parameter values. At this point you might want to open
the .csv file as a reference for the formulas.
7. In the Formula column for Fitting OD 1, enter the following:
size_lookup(Lookup Table Name, "FOD", Nominal Diameter 1, Nominal
Diameter 1)
How did we arrive at this formula? Using the format from the first part of the
handout and Pipe Fitting - CSRW.csv. FOD is the name of the column of values we
would like to populate the Fitting OD 1 parameter. The first Nominal Diameter 1 is
12
what we want to use as a value if Revit cant find one in the .csv file. The last value,
the second Nominal Diameter 1 is the lookup value. This means that Revit looks at
the first column after Reference Column (ND) and compares it to the value in the
family for Nominal Diameter 1. If this value corresponds to a value in any row, Revit
will populate the Fitting OD 1 parameter with the value of FOD from the same row.
8. Repeat the process for the Fitting OD 2 parameter, using the FOD column
again.
13