Replacing Families

Hello, I have a situation where I have a bunch of column families that need to be replaced with a different column family. They are the exact same in size, just named differently… for this purpose A1,A2,A3,A4 and I need to replace them all with columns B1,B2,B3,B4.

Hi ctaiariol,

It is possible, but it can also be a bit difficult depending on the differences between families.

As long as the families are built the same and use the same parameters, it should be easy enough.

Otherwise, it is also a straight-forward task to group the columns in a Revit table, add the family and type parameter, and just change the families in the table. Scripting may not makes sense until it requireds exchanging many different families and family types multiple times in a project.

Thank you for your feedback. I am fairly new to the dynamo environment so I was curious if this would be a good time to practice scripting, solving a real world issue I’ve got at hand. Currently, I am swapping the families in a schedule within Revit.

If you want to play around, then I would suggest starting with a detached copy, isolating a few columns in the views, and start your script by select the model elements and building the logic off of that.

This has the added advantage that you can probably keep your script in automatic mode and keep the computation times low. You will probably need to use some sort of key in order to sort and filter elements. I have been working on large projects and we have type-naming conventions (with abbreviations to avoid typing errors and lengthy names.) The type name is also used extensively for filtering elements in different software applications (including excel) and especially in dynamo.

With a column, it should actually be quite simple since most of the parameters will be type-based and only the hard-coded top and bottom level constraints are important. Otherwise, any instance-based information MAY also need to be copied. For hard-coded parameters like “Comments” the information will remain unchanged. If you are using shared parameters, then both FAMILIES need to contain the same set of SHARED parameters.

That’s a long-winded way of saying, information may be lost if you are not careful. This is not a dynamo-specific problem, but a general issue and you will run into it if you change the elements in the table. Dynamo will however allow you to capture the information and write it into the swapped element.

Here is a screenshot which shows the most basic way to change the family and type of something:

Thanks @m.owens, I’ve got it to swap out one column type for another.


Is it possible to swap out all column types that have a prefix of SA_ with their counterpart column types that don’t have a prefix? I’m looking for a one stop, batch swap. ex. SA_ Wall Panel – Wall Panel, SA_ Corner Panel --Corner Panel.
I’m thinking I need to separate them by the name so that all column types with an SA Prefix are in one list, and the columns without a prefix are in another list…?

If the only difference in the family type naming is the “SA” prefix / suffix, then it would be simple enough to operate on the strings to add or remove the “SA” and select the family based on that.

I would use the following workflow:

  1. All elements of category
  2. Element.Name
  • String Contains if you want to filter certain elements using a Filter.Mask

  1. Group by key using the element.name
  2. String Operation add / find-replace
  3. Get Family Type or Wall Type by Name
  4. Set Parameter by Name