Rename elevation views

Hello everyone,

I’ve developed a routine that renames all elevation views in the project to a new numbering system. For example, renaming view A101 to B201.

However, when I run it in REVIT, I’m getting the following error message:

image

Could someone help me understand what might be causing this issue? I’m not sure what went wrong.

I’m sharing the routine code below.

Thank you all in advance for your help.

What does the list of view names look like before you try to rename it? It could be a case of the first item you’re renaming is the same as another item in the list ready to be renamed. It’s the same case for any workflow that attempts to change the numbering of views detail numbers that are already numbered, B2 is still B2 as you’re trying to change C1 to B2. To help with that, you’ll want to rename all the views before you give them the name you want. You can do this by adding an “x” or a “!” or some random character or phrase to the front or back of the name prior to the last set parameter.

Hope this helps!

3 Likes

A couple of things-

  • It would help us to understand what is going on if you expanded the previews in all your script so we could see the inputs/outputs to each node
  • Why not just use the “Categories” node instead of selecting an element and getting the category from it? Are you thinking of element Type instead?
  • If for some reason, you need to have two views with the same name (as it shows on the sheet) you can use the “Title On Sheet” parameter - but the “View Name” parameters must be unique
  • As Patrick says, you almost certainly already have a view that is named identically to what you want to change it to…
  • Either that or… I’m not sure what your current naming scheme is, but if the are all a letter and 3 numbers, and you are passing 130 of them to your script, you will end up with some duplicates.
  • 130 elevations visible from your view?

Good luck,
Joe

1 Like