I imported new Structural Framing types into Revit from a 3rd party software. Now I would like to replace all elements assigned to one of these types into a Revit “standard” types.
For instance, I now have a Revit project with structural framing elements of the following types:
and I would like to replace all elements from these types to the following “original” types of Revit:
Assuming I have a mapping between these 2 lists in an excel file or any other solution - how can I programmatically (or without using Python for Dynamo) replace all those structural framing elements from the types in first list above to the types in the second list above?
I managed to do a simple graph in Dynamo that manually iterates over the lists and updates those elements - but this is inefficient in case of many types I need to swap.
Looking for an iteration solution.
This works for me, assuming you just want the first family type of each family to be used. If you want types to be considered then you will need to add more data and list management.
Suggest in future you attach sample files and your script to get better help. In light of this, here is a screenshot of my script
Family types.xlsx (8.7 KB)
Thank you, Gavin!
We will share some screenshots as I think this is not the exact solution for our case. We need to iterate over all family types of each family exists in, for instance, Structural Framing category.
The family by name parameter can return a family of any category however so it should work for any category really. You can incorporate types as a second column and then use them to get a family type by family name + type name which is another node similar to the one I used.
I intend for you to use my example simply as a reference for how you may continue to solve this challenge - the exact solution is up to you.
In your opinion this could be resolved involving custom Python node or by using only pre-defined nodes?
Most things can be done with no Python when it comes to replacing families.
Popping up this post as I am still getting confused with the process.
I have the following Revit structure:
Currently model does not contain any elements from UPE80/UPE100/UPE120 and it does contain elements from UPE 80.European-V1.steel / UPE 100.European-V1.steel / UPE 120.European-V1.steel.
All elements under “UPE 80.European-V1.steel” family type, I would like to change their family type to “UPE80”. Same goes for UPE100 and UPE120.
I am trying to use this excel file to do the matching -
Family types.xlsx (8.8 KB)
This is my current graph but I don’t think I am on the right track:
Tested this and it seems to work. Didn’t have your model available so just used my own instead.
Replace families.dyn (16.7 KB)
sample.xlsx (9.5 KB)
Swap beams.rvt (2.0 MB)h
Works like a charm!!!
Thanks a lot, @GavinCrump
This works for loadable families. Do someone have something for system families?
Element.setparameterbyname with the ‘Type’ parameter as name and a suitable type to swap it with should work. I think clockwork might have a more basic node than that again for setting typed iirc.
If I use it for walls, I get null as output? Why should that be?
And sometimes with loadable families I got an empty list as output? Whats the reason for that?
I think you’ll need to use the all elements of type node and the element types node to get wall types then can find matching index of the type name to get the intended wall types instead. If i recall correctly the family type node deals with loadable family types versus system.
The clockwork node probably expects a different list structure, and/ or no elements of those types are placed.
Thanks! Problem for the loadable families was that he didn’t find the elements.
For the system families I already tried with all elements. See topic I made, hopefully you see the solution? My goal is to change all my system/loadable families of an existing project with excel. Such as a configurator in Excel and push the changes to Revit.