Find and replace to rename views in Revit using Dynamo?

Hi All,

When creating new floor plan views. It adds a little (1…n) after the name. I would like to rename that with something more meaningful like “structural” for instance. See below:

Since there is a lot of views and this is very repetitive, is there a way to rename the (1) into something else using Dynamo?

Thank you in advance for your reply.

Kind regards,

Vincent

1 Like

Hello Vincent & Welcome.

You can definitely rename views pretty easy with Dynamo. I suggest going through the Dynamo Primer as it has a lot of great information and samples to go through.

For views, look into “Element Types”–>“All Elements of Type” and “Element.GetParameterValueByName” and “Element.SetParameterByName” to give you an idea on what you can start doing.

Cheers,

Matt

Hi Matt,

Thank you very much for your reply. Very helpful. I could manage to make it work with the information you gave me.

Here is the final outcome:

Thanks again for your precious help :slight_smile:

Kind regards,

Vincent

Hi,

actually this is works better.

Cheers,

Vincent

2 Likes

i tried to use this code and it was fine at this point every thing is oky

this is exactly what i need

after click run, the Original Level Names change not the view name only

You are setting names for all views, not a filtered list. Modify the graph accordingly.

Hi guys,

I’m a rookie at this…
I am trying something similar but get error code:
dereferencing a non-pointer

Any ideas?

Thanks in advance

You’re feeding a parameter value into the element on the node that is erroring. You need rework your filter to remove elements not parameters.

This was the approach I was thinking, but the View Name Parameter appears to be missing in version 1.3. I list out all of the parameters from the first item of the view elements and View Name is not there?! Can anyone verify that this has become inaccessible? I keep receiving an error about referencing a non-pointer.

Accessible for me. Can you post a screenshot?

Not on a laptop now, but it should be a View.Name node under the Revit tab. If not try using the Element.Name one as it should work as well.

There is no such node. Any insight into why this parameter is missing? Is it buried in some other aspect of views that require more nodes to get at?

You can use the Element.Name node to get view’s names as well.


Make sure you don’t input any null value as it will throw an error.

View name does show up in the element parameters. Note that these are not sorted alphabetically so it helps to sort them by name sometimes.

If your view isn’t really a view (let’s say it’s something other than a view but is in more along the lines of a view type) you’ll get results like your first post a few days back. These non-view elements which show up when selecting by category are important to the project and don’t get purged unless you do something rather odd. I used to know what these were for but it’s escaping me at the moment. In any case because they don’t get deleted or made obsolete as normal views might they tend to become the ‘first’ items in the list when you get all views by category (these are sorted by element id).

Try getting all views the way you did and then wire in an Element.GetParameterValueByName node with a parameter value of “View Name” and you’ll start to see what I mean.

This describes it perfectly. I thought I was taking crazy pills. Still seems a tiny bit glitchy that you have to workaround the non-view elements to get at the data you want. At any rate this was really helpful. Thank you everyone for clearing this issue up.

…Except that those warnings seem to persist and cause other problems:

You need to select your views differently to make these types of workflows function without error. Archilab has a good node for this type of selection.