Revit Formulas v. Type Catalogs v. Lookup Tables
People are fond of telling me “There is more than one way to screw up” and that I have covered most of the possibilities. I recently wrote about taking a serious look at Autodesk® Revit® standards and procedures and asking why. In the spirit of following my own advice I have found myself thinking about when to use formulas in families, when to use type catalogs, and when to leverage lookup tables. The three tend to provide overlapping uses, especially when perverting their intended use. This article will give an overview of how to deploy the three options, possible applications, and a comparison of benefits. As always, different firms have different cultures and skill sets, which should lead to differing views of what the best solution is.
Formulas in Families
A good example of a formula in a family is creating a self-sizing neck on a supply diffuser. A formula is used to size the diffuser neck based of the flow in the diffuser. An instance parameter has been added to the default supply diffuser family called “Neck Radius.” The following formula associated to the new parameter.
if(Flow < 141 CFM, 0' 3", if(Flow < 266 CFM, 0' 4", if(Flow < 351 CFM, 0' 5", if(Flow < 441 CFM, 0' 6", if(Flow < 586 CFM, 0' 7", 0' 7 1/2")))))
This formula asks if the flow is less than 141 CFM. If so the “Neck Radius” parameter is set equal to 3”. If that is not true it goes on to see if the flow is 266 CFM, 351 CFM, 441 CFM, and 586 CFM, each time associating an appropriate neck size based of the reported CFM. If the flow is higher than 586, then 7 ½” is assigned to the “Neck Radius” parameter. The half-inch is an indication that the size should be reviewed.
The CFMs in the above formula should correlate to design manufacturers’ recommendations. The top of the diffuser extrusion can be controlled by the “Neck Radius” parameter by placing a dimension on the extrusion sketch and associating it. The same should also happen with the duct connector.
In an appropriate workflow, the diffuser necks and runout ducts are automatically sized. I recommend adding a parameter to override the automatic sizing, knowing there are occasions to size neck independent of the flow.
This process works because it controls instance parameters so well. The individual instances of the same diffuser have differing necks sizes.
When you have a family that has a lot of types, using a Type Catalog may be the best choice for helping users navigate them. An obvious example is structural steel. In that case there are many different choices and each choice changes the shape, weight, and identity of the family. Type catalogs use a lookup table to assign the appropriate data needed for the different available types. It is important to note that the type catalogs can only drive family parameters and not project parameters.
For this example, a dishwasher family is created and named dishwasher.rfa.
Select the Family Types button to identify the parameters to associate with the lookup table. For this example, use Model and Manufacturer (Figure 2). For this to work correctly, some data must be placed in the Value column. The words model and manufacturer will work, the letter X or any other characters will work as well—just don't leave them blank.
Next, a lookup table needs to be created. I start with an Excel file that will be converted to a TXT file. Save this file with the exact same name as the family. Only the file extension should be different.
Leave cell A1 blank (Figure 3). Revit recognizes this as a heading for Family type, which will start below it. Placing any data here will cause things not to work. Fill out the rest of the cells as indicated below.
Column A defines the family Types that can be created.
Column B defines the Model number assigned to that type.
Column C defines the Manufacturer assigned to that type.
The column headers for Model and Manufacturer are a combination of the parameter name to be controlled and a code for the parameter type. The codes are listed below.
- Angle ##ANGLE##DEGREES
- Area ##AREA##SQUARE_FEET
- Currency ##CURRENCY##
- Integer ##OTHER##
- Length ##LENGTH##FEET
- Material ##OTHER##
- Number ##OTHER##
- Slope ##SLOPE##SLOPE_DEGREES
- Text ##OTHER##
- Volume ##VOLUME##CUBIC_FEET
- *Yes/No ##OTHER##
*When using a Yes/No parameter, the Yes=1 and No=0.
When done, save this Excel file with a CSV file type (Figure 4).
Then change its extension in Windows Explorer to ".txt” (see Figure 5)
Test this by loading the dishwasher family into a new project. The type catalog will only show up when the family is loaded. Placing a second dishwasher will not bring it up again.
In the type catalog example above, the family type selected drove the model and manufacturer name. In this next example a lookup table will be used to associate feeder information from a scheduled tag using the Revit function size_lookup. Many firms tag feeders in their electrical riser diagrams, then refer to a feeder schedule for information such as number of conductors and conduit size. Here a is possible way to build a feeder schedule automatically.
First, create a lookup table to store the data. To keep things simple, the example below has only two columns. Again, cell A1 should remain blank just like the type category example in Figure 3. A2, A3, and A4 contain the number of current carrying conductors associated with the Feeder labels to the right in column B (Figure 6). This means a feeder tagged with a 4 will have two current carrying conductors and a feeder tagged with a 2 will have three. When the “tag” is created, a TAG parameter must be added to refer to in cell B1. Save the lookup table in CSV format where your Revit template is looking for lookup tables or add a new location.
Second, create a faux tag using the Generic Annotation template. The reason for using the generic annotation template is that you cannot schedule a tag, but you can create a Note Block schedule of these symbolic tags. Create the TAG parameter. Make it an instance parameter of type “Integer” (see Figure 7).
Then create a parameter for the number of current carrying conductors. In the example family I named it “Conductornumber.” Click the “Manage Lookup Tables” button in the lower right-hand corner of the Family Types dialog to import the Lookup table created in the previous step (Figure 8).
Because it might be necessary to have multiple lookup tables in a single family, it is typical to create a parameter for each lookup table so they can be called with the size_lookup function. I creatively named my table parameter “Table.” Give the Table parameter the value of the name of the csv file it should be referring to in the family Types dialog of the “tag” family.
Create the line work required for your “tag” and add a TAG label which can be edited by the end user.
Lastly, enter the formula for determining the number of current carrying conductors. It is “size_lookup(Table,"","NA",TAG)”
Here is how it works: “size_lookup” is a Revit function prompting Revit to find an appropriate lookup table. “Table” is a parameter directing Revit to the correct table. The double quotes refer to the column in the table which has no header. This is where we entered the number of current carrying conductors. “NA” is the value Revit will report if it cannot find a corresponding TAG number in the associated table. “TAG” is the column header to which Revit is looking to match a Conductor number. Family Types should be created for each TAG value.
Now when the TAG parameter has a corresponding match, the Current Carrying Conductors parameter will automatically populate. This can obviously be expanded to include all required fields for a feeder schedule, allowing users to simply tag feeders.
To complete this, create a schedule using the Note Block tool. Select the annotation family created for the feeder tag, then build your schedule as usual (Figure 10).
I hope this is a good introduction to applying formulas, type catalogs, and lookup tables. There are plenty of solutions for making processes work better. The trick is to pick the best one possible. Revit offers clever users even more ways to pervert the out-of-the-box tools. My suggestion is to try everything, be open to new ways, and always try to improve the previous solution.