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.
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:
- All elements of category
String Contains if you want to filter certain elements using a Filter.Mask
- Group by key using the element.name
- String Operation add / find-replace
- Get Family Type or Wall Type by Name
- Set Parameter by Name
Hi All, I am having a similar issue, but I need to pass on the Width and Height parameters to the new types. I’m at a loss, and hoping someone can point me in the right direction?
I am not getting any errors, it just isn’t working as expected (i.e. not at all haha).
The goal is to change the keynote background to another type (different families. Duplicates renamed to prevent errors type stuff. So a batch of imported views now contain “background7” and stuff like that) but changing the family results in it defaulting to the standard size, not the initial size of what was replaced. Any pointers?
I was able to make this work. I am posting a copy of the dyn here for anyone else that has a similar issue.
1 dyn each for a single family or all families. Uses dropdowns. I designed this for a detail item, but should be easily convertible for other categories of family. Dynamo player friendly.