A client of mine is working on a large multi-building project. As often happens on these big projects, the names and designations of the buildings changed mid-way through the project. This kind of thing happens all the time and it’s always a headache. Updating all those names is tedious and it takes a lot of time. They estimated it would take two people a full day to update all the rooms, sheets and views to the new building names. That’s a total of 16 hours just spent renaming things. I don’t know about you but that sounds like a pretty boring way to spend your day.
Fortunately changing the names of things in Revit is easy to automate with macros and the API. Renaming a group of elements is a two step process. First, you create a collector to gather all the sheets, views, room tags or whatever you want to rename. Once you have all the objects, you simply loop through the collection and change each object’s name parameter. If you’re replacing an old name with a new one, you can use a conditional statement to do the swap. The name parameters differ from object type to object type so you’ll need to refer to the API documentation (which you can download here) for the exact parameter name.
Download the macro
You can easily rename rooms, sheets and views with these Revit macros. In this example, the building names are changing from from “North 1”, “North 2”, “South 1” and “South 2” to “B1”, “B2”, “B3” and “B4” respectively. The macros look at each object’s name and replaces “North 1” with “B1”, “North 2” with “B2” and so on. You can edit the code to use your own building designations. As you’ll see, the code is very straightforward.
You can download the macro (in Revit 2015 format) from the ArchSmarter Revit Macro library. Don’t have access? Sign up for ArchSmarter updates in the form below and get immediate access to this and other time-saving Revit macros!
If you need to rename a lot of things your Revit file and don’t feel like writing a macro, check out Andreas Ricke’s ARUtils add-in for Revit. It includes a comprehensive renaming tool.