I recently was working on a Revit template, and wanted to rename a lot families within the template. Now I could go through the manual and tedious process of renaming all the families. The other option would be to write a script that would do it for me (and for future projects).
![Rename Revit Families With Dynamo](https://static.wixstatic.com/media/1865b4_b208e1ace75e419496c3b7d188a8b301~mv2.jpg/v1/fill/w_980,h_455,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/1865b4_b208e1ace75e419496c3b7d188a8b301~mv2.jpg)
Here is the full script. Very simple.
![](https://static.wixstatic.com/media/1865b4_c6a6ff8e6e2646028ae55525c5528559~mv2.jpg/v1/fill/w_980,h_245,al_c,q_80,usm_0.66_1.00_0.01,enc_auto/1865b4_c6a6ff8e6e2646028ae55525c5528559~mv2.jpg)
The "All Elements of Type" node paired with the "Element Types" node grabs all families whether placed or NOT. This is really critical as I always tend to use the "All Elements of Category" Node, however the "All Elements of Category" node only grabs placed elements, not unplaced elements. I wanted all families in the file, not just the placed ones.
![](https://static.wixstatic.com/media/1865b4_20da3390ee844b3fa94a78ec75aa3ecd~mv2.jpg/v1/fill/w_648,h_216,al_c,q_80,enc_auto/1865b4_20da3390ee844b3fa94a78ec75aa3ecd~mv2.jpg)
Next I wanted to set up a filter, so I could target only the families I wanted to rename. In this case, the window families had a CSI prefix of 0842, so that became my filter criteria. You can pick whatever filter criteria you would like for your project.
![](https://static.wixstatic.com/media/1865b4_72bbe0877bc34ddbac7cf34f94d5b9ea~mv2.jpg/v1/fill/w_823,h_618,al_c,q_85,enc_auto/1865b4_72bbe0877bc34ddbac7cf34f94d5b9ea~mv2.jpg)
Next, I needed to Find and Replace, so I could rename my families. Use the "Element.Name". This one is available in the Clockwork package
![](https://static.wixstatic.com/media/1865b4_d2b853244165408b9bc8f88586fd4bae~mv2.jpg/v1/fill/w_616,h_399,al_c,q_80,enc_auto/1865b4_d2b853244165408b9bc8f88586fd4bae~mv2.jpg)
Finally I used the Element.SetName node (Also it the Clockwork Package) to push the change back to the families.
![](https://static.wixstatic.com/media/1865b4_ce46999cb5f74d2b974dd55ce2876f2e~mv2.jpg/v1/fill/w_790,h_647,al_c,q_85,enc_auto/1865b4_ce46999cb5f74d2b974dd55ce2876f2e~mv2.jpg)
Again, here is the final script in it's entirety. Simple, but useful.
![](https://static.wixstatic.com/media/1865b4_c6a6ff8e6e2646028ae55525c5528559~mv2.jpg/v1/fill/w_980,h_245,al_c,q_80,usm_0.66_1.00_0.01,enc_auto/1865b4_c6a6ff8e6e2646028ae55525c5528559~mv2.jpg)
If you want this script, you can download it from here- Dynamo Script
Did you know EvolveLAB can host Dynamo Workshops at your office or build custom scripts for your project? Reach out to Bill at bill.allen@evolvelab-inc.com to find out more.
![](https://static.wixstatic.com/media/1865b4_967b56dcddf8422f9dcada30ba016046~mv2.png/v1/fill/w_980,h_712,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/1865b4_967b56dcddf8422f9dcada30ba016046~mv2.png)
Bill Allen is the managing principal for EvolveLAB, helping Architects, Engineers, and Contractors be successful with their processes. Bill is also a regular speaker at Autodesk University, The BIM Workshops, and the Design Symposiums. If you would like to connect with Bill, reach out directly at bill.allen@evolvelab-inc.com