# How to rename multiple Revit views

**URL:** <https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564>\
**Category:** Revit\
**Tags:** revit, views\
**Created:** [August 7, 2018, 3:02pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564 "2018-08-07T15:02:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan.saluzzi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ryan.saluzzi/32/53126_2.png) [@ryan.saluzzi](https://forum.dynamobim.com/u/ryan.saluzzi)\
**Post date:** [August 7, 2018, 3:02pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/1 "2018-08-07T15:02:14Z")

</div>

Hi all,  
I’m brand new to Dynamo but have been using Revit for a few years now. I typically am the setup/organization guy for all project views, but haven’t quite figured out exactly the best ways yet but this is what i have going on right now on an active project.

I need to establish 4 cropped down “zones” for every level of my building, for HVAC pipe & duct to create my shop drawings on. So what i have been doing is creating a “Master” view on which all my annotations go and then dependent views for each zone as well as my duct or pipe legends, giving me 8 dependent views for each “Master”.Then each view can get put on the sheets for the specific zone to create my shop drawings. I want to be able to take a newly created set of dependent views though and then use Dynamo to rename them to my final name format rather than doing it manually one by one. This is what i have come up with thus far.

 ![Dynamo%20View%20Rename%20Script](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/0/a0321741ee6890ed5da6de62daac519399eef998.jpeg)

So this seems to work for the one string replacement that i have connected currently but i want to be able to build in all 8 scenarios (one of each of the two different scenarios are shown above) and then be able to run the script one time to turn my default name list to my final renamed list.

**_Example Default List_**  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 1  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 2  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 3  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 4  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 5  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 6  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 7  
L10 - PLAN - DRY - SHEET - MASTER - Dependent 8

**_Example Final List_**  
L10 - PLAN - DRY - SHEET - Z1  
L10 - PLAN - DRY - SHEET - Z2  
L10 - PLAN - DRY - SHEET - Z5  
L10 - PLAN - DRY - SHEET - Z6  
L10 - PLAN - DRY - SHEET - Z1 - LEGEND  
L10 - PLAN - DRY - SHEET - Z2 - LEGEND  
L10 - PLAN - DRY - SHEET - Z5 - LEGEND  
L10 - PLAN - DRY - SHEET - Z6 - LEGEND

I think i could create the string replacement setups for each scenario and then just connect/disconnect each to the set parameter by name node as i run through each of the 8 scenarios but i was hoping maybe someone might know a way to run them all together simultaneously. Any help is greatly appreciated!!

---

<div class="post-metadata">

**Author:** ![khuvv.hp](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khuvv.hp/32/52961_2.png) [@khuvv.hp](https://forum.dynamobim.com/u/khuvv.hp)\
**Post date:** [August 7, 2018, 3:09pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/2 "2018-08-07T15:09:33Z")

</div>

you can see topic [https://forum.dynamobim.com/t/write-assembly-name-to-assembly-detail-view/24520](https://forum.dynamobim.com/t/write-assembly-name-to-assembly-detail-view/24520)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [August 7, 2018, 3:45pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/3 "2018-08-07T15:45:01Z")

</div>

Hi @ryan.saluzzi,

You can make an IF statement if you want rename all views at one time.

 ![IF%20statement%20rename%20views](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/7/6740c9bc369865c9c99461e7f81baf4e80bc1acc.png)

x==1?  
"Z1":  
x==2?  
"Z2":  
x==3?  
"Z5":  
x==4?  
"Z6":  
x==5?  
"Z1 - LEGEND":  
x==6?  
"Z2 - LEGEND":  
x==7?  
"Z5 - LEGEND":  
x==8?  
"Z6 - LEGEND":  
"";

---

<div class="post-metadata">

**Author:** ![ryan.saluzzi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ryan.saluzzi/32/53126_2.png) [@ryan.saluzzi](https://forum.dynamobim.com/u/ryan.saluzzi)\
**Post date:** [August 7, 2018, 3:50pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/4 "2018-08-07T15:50:25Z")

</div>

Hi @Alban_de_Chasteigner,  
Can this work for multiple levels though? The L10 names was just an example for one level (10th floor) and i will need to replicate this across all floors up to L37 (37th floor). It looks like you just typed in the example names i gave, unless i’m not understanding exactly how you created your script. I definitely don’t want to type all my view names in for each floor

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [August 7, 2018, 3:53pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/5 "2018-08-07T15:53:39Z")

</div>

Yes it will work for all the levels if “Dependent 1” is always equal to Z1, etc, if “Dependent 5” is always equal to “Z1 - LEGEND” and so on.

---

<div class="post-metadata">

**Author:** ![ryan.saluzzi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ryan.saluzzi/32/53126_2.png) [@ryan.saluzzi](https://forum.dynamobim.com/u/ryan.saluzzi)\
**Post date:** [August 7, 2018, 6:20pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/6 "2018-08-07T18:20:30Z")

</div>

@Alban_de_Chasteigner so what do i use in place of the code block for the view names then to get it to pull in my list of view names from my Revit project browser?

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [August 7, 2018, 7:04pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/7 "2018-08-07T19:04:09Z")

</div>

View Type from archilab package is what you need

 ![Views](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/1/b1484c1f93d86e13e298379825eb9ee6d6844eb9.png)

---

<div class="post-metadata">

**Author:** ![ryan.saluzzi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ryan.saluzzi/32/53126_2.png) [@ryan.saluzzi](https://forum.dynamobim.com/u/ryan.saluzzi)\
**Post date:** [August 7, 2018, 7:27pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/8 "2018-08-07T19:27:33Z")

</div>

This is what i came up with, can you take a quick look and see if this all looks right before i run it?

 ![Dynamo%20View%20Rename%20With%20If%20Script](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/7/97a1303aada8cb4786e263035e575fa6cdb91dee.jpeg)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [August 7, 2018, 7:30pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/9 "2018-08-07T19:30:04Z")

</div>

There is a mistake in the If statement.  
There is a small “x” and a capital letter “X”

---

<div class="post-metadata">

**Author:** ![ryan.saluzzi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ryan.saluzzi/32/53126_2.png) [@ryan.saluzzi](https://forum.dynamobim.com/u/ryan.saluzzi)\
**Post date:** [August 7, 2018, 8:36pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/10 "2018-08-07T20:36:32Z")

</div>

Cool thanks for your help @Alban_de_Chasteigner, I appreciate it.

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [August 7, 2018, 8:38pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/11 "2018-08-07T20:38:24Z")

</div>

You’re welcome.  
Let me know if it works.

---

<div class="post-metadata">

**Author:** ![ryan.saluzzi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ryan.saluzzi/32/53126_2.png) [@ryan.saluzzi](https://forum.dynamobim.com/u/ryan.saluzzi)\
**Post date:** [August 7, 2018, 8:57pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/12 "2018-08-07T20:57:05Z")

</div>

![Dynamo%20View%20Rename%20With%20If%20Script%20-%20First%20run](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/4/9412fb1fa883bc17008f3a9695746114fc796032.jpeg)

This is what i get, not what i was expecting at all. Any ideas on how i can fix this?

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [August 7, 2018, 9:00pm UTC](https://forum.dynamobim.com/t/how-to-rename-multiple-revit-views/24564/13 "2018-08-07T21:00:30Z")

</div>

The last String.Remove must have a value of -1 not 1.
