# Renaming Views by string replace

**URL:** <https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311>\
**Category:** Revit\
**Created:** [July 15, 2019, 6:40pm UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311 "2019-07-15T18:40:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![briecheesepls](https://avatars.discourse-cdn.com/v4/letter/b/b782af/32.png) [@briecheesepls](https://forum.dynamobim.com/u/briecheesepls)\
**Post date:** [July 15, 2019, 6:40pm UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311/1 "2019-07-15T18:40:47Z")

</div>

I am trying to rename multiple views that have been named using “Floor 1”  
I filtered by parameter name and string.  
But I keep getting a error from Revit.

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/a/1a519302984ebeeb6f013daad755dcce46e57fb6.png)

here is a clip from my workspace.  
I’m thinking I need to fix my list from FloorPlanName to ViewName but I’m not sure how.

 ![change%20view%20names](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/05ff211de312057cd63e5537924509cac2c02763.png)

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [July 15, 2019, 6:54pm UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311/2 "2019-07-15T18:54:49Z")

</div>

You are feeding “View Name : ……” as a value in the Element.SetParameterByName  
you can’t as Revit says cannot contain the following characters in this case thus _ **:** _

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [July 15, 2019, 8:15pm UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311/3 "2019-07-15T20:15:18Z")

</div>

You want Element.GetParameterValueByName instead of Parameter.GetParameter.

---

<div class="post-metadata">

**Author:** ![briecheesepls](https://avatars.discourse-cdn.com/v4/letter/b/b782af/32.png) [@briecheesepls](https://forum.dynamobim.com/u/briecheesepls)\
**Post date:** [July 15, 2019, 10:32pm UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311/4 "2019-07-15T22:32:40Z")

</div>

this worked! thank you.

---

<div class="post-metadata">

**Author:** ![EzDoesIt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ezdoesit/32/70125_2.png) [@EzDoesIt](https://forum.dynamobim.com/u/EzDoesIt)\
**Post date:** [July 16, 2019, 4:43am UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311/5 "2019-07-16T04:43:50Z")

</div>

please mark as solution

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [July 16, 2019, 2:40pm UTC](https://forum.dynamobim.com/t/renaming-views-by-string-replace/38311/6 "2019-07-16T14:40:50Z")

</div>

You also want to make sure that you Apply the view names with the same FilterByBooleanMask because your current graph will not be naming things correct I don’t believe.
