Rename View titles on sheet

Hi guys,

I wrote a script that is suppose to collect, filter and rename view titles on any number of sheets within a revit project. This is because our naming conventions often change and someone has to go through and rename the views based on these new parameters. A prefix of “L.K” for example, for Luxury Kitchen becomes “L.KT”. I wrote this script to find and filter all the views that have the undesired prefix and then replace it with the desired prefix. it works all the way up to when I am pushing the new names back into the elements as parameter values.

Here is a ink to my script.
If anyone can let me know why its not working I would greatly appreciate it.
ViewTitleReplace.dyn (24.7 KB)

Thanks Tiara

@dobbst01 Can you show some screenshots of the nodes that are not working? what errors do you get?

Also can you post a rvt file (or a link)

The problem is that no node appears to be not working.

image

I think the script should work with any old Revit file with a view and a title. I can post one but there isn’t much point but if it will help then I can.

There is also a python script used here:

image

Thanks again for taking a look

hi @dobbst01,

Can you show us what every nodes retrieve, and take a new screenshot of your graph using this one:

  1. Retrieves element of category ‘ViewPlan’
  2. Parameter “View on sheet”
  3. Search string “L.K” is undesired string to search for in view title name list
  4. Search string “L.KT” Is the desired string replacement for the view title

  1. Output of viewplan search node
  2. Name output of all elements of viewPlan
  3. Filter that culls out ViewNames from list that do not have the “L.K” and therefore do not need to be changed.
  4. The collective ID’s of all the View title ID’s

  1. Filter out any views that might already by the correct prefix L.KT and thus may become a problem when we add “L.K” = L.KTT".
  2. Find and replace new name values with “…L.KT…”
  3. Output of the changes as the parameter value is changed.

I could probably do with a few more ‘watch’ nodes in there, so if you still are not following, chuck in more to help get the picture.

Thanks again for all the help!

Just a quick thought:
You’re comparing Element Id’s with the value of “Title on Sheet”. Are you supposed to do that?

Hey so I got the script working! it turns out It was changing the names but I was looking at the wrong sheet. I have added a few extra nodes to work with the dfferent view types such as 3D views, view sections and view plans. I am yet to do View elevations but if someone has somthing to help with that it would be greatly appreciated.
ViewTitleReplace.dyn (26.7 KB)

Here is the script and a screenshot of the final output.

1 Like