August 15, 2013

Revit: Type Catalogs

A few months back I had my first experience with creating an Autodesk® Revit® family driven by a type catalog. I am finally getting around to documenting some of what I learned, so I do not have to learn it again, next time. For the record, the observations below were made while using Revit Architecture 2012; I have not yet worked with type catalogs in the 2014 release.

Yes/No Parameters
The column header format for Yes/No Parameters is: [ParameterName]##other##
where [ParameterName] is the name of the Yes/No parameter. The values assigned to this parameter for each type need to be either 0, for No, or 1, for Yes.

Text Parameters
If your type catalog includes a text-type parameter, such as the out-of-the-box Type Comments parameter, you have to add a value to that parameter in the family file. If the parameter is left unedited, when you try to load the family, you will get a Warning...
...and none of the values in your type catalog will be imported into the type(s) you chose to load into your project. If you edit the text parameter in the family, even by simply typing a single character and then deleting it, Revit recognizes that the parameter has been edited and will load the type catalog values as expected. In order to avoid confusing myself, I plan to leave some visible text in the family for each text parameter I have in the type catalog, so that I can see that the parameter has been edited. If a type needs a text parameter to be empty or blank, a blank value in the type catalog will overwrite the value in the family file, leaving the value of that parameter blank for that type.

Editing the Type Catalog
  • Once you load from a type catalog into Revit, it puts a lock on the text file that holds the type catalog data. I had to close Revit completely (not just the model into which I loaded the types from the type catalog) to get the lock to be released so that I could rename the file. I did discover that you can open, edit and save the type catalog text file, even with the lock on it, but I wanted to replace the file with a new one generated as a CSV file from the Excel file where I was doing the editing. While I could not rename the type catalog file and then rename the new CSV to replace it without closing Revit (which does not make for a very efficient testing period), I found that I could copy a new version of the type catalog file from another folder and overwrite the old version that Revit had locked, so I amended my workflow to moving the CSV file to another folder, renaming it by changing the extension to "txt" and then moving that file to the old version's folder, overwriting it.
  • If Excel (or another spreadsheet program) is used to generate the type catalog text file (by saving as a comma-separated values [CSV] file, and then changing the file extension to "txt"), you can use formulas in the Excel file to generate the values that end up in the type catalog. A formula in the Excel file can be applied on a per-type basis, whereas a formula added to a parameter in a family in Revit applies to all types in the family. As an example, the family I was generating represented the elevation of a Door. Some of the types had had glazing, and I needed to specify how far from each edge of the door the glazing started. Some glass was "full-width," with equal stiles and other glass was a lesser, given width. I was able to use a formula to calculate the glass width opening for the full-width types by subtracting twice the stile width from the overall width, while simply directly entering the value of the given-width glazing in the other types. I am sure there is a way to use multiple formulas and a Yes/No parameter to achieve that directly in a family, but since I was creating a type catalog anyway, it was nice to be able to have the flexibility to customize the formula on a per-type basis in Excel.

No comments: