Filtering views by prefix in view name

Hello,
I would like to remove a prefix which was added to some of my schedule views. I am a beginner with Dynamo so I am quite unfamiliar yet with the available nodes. In my graph I have been able to retrieve the View Name property but I do not know how to filter this list of all views to include only those views whose names begin with the specific prefix. Specifically, the view names in question begin with the prefix “zCover”. The second part of my graph has various nodes which can remove the prefix from the names, but this is after the names have been converted to strings. So I have two parts in my graph: the first has all schedule view names, which I would like to filter; and the second has a workflow which removes the prefixes from strings, but I do not have a filtered list to which I would apply these altered view names. I appreciate your help with this.

Also, I am using Dynamo Revit 1.3.4.6666, and the red number (is this the version number?) says 2.0.3.0

Views - Remove prefix from view name.dyn (10.3 KB)

You may not need to filter them. If you’re only trying to remove the zCover prefix from schedules that have it, you could probably just replace that substring with an empty string ("").

Oh I see. So the replace tool would inherently filter the list? That makes sense, I will give it a shot, thank you!

That worked for the filter. Now, after I run the script, I’m getting the problem of all my schedules’ names starting with “ScheduleView(Name = [new schedule name] )”, with the bracketed part being each schedule’s name. The prefix “zCover” is now gone, but this has made an even larger problem. Any idea how to get this new prefix to not show up when I run the script?

Views - Remove prefix from view name.dyn (12.6 KB)

Sounds like you didn’t get the name the correct way. Can you share an image of your graph with node previews turned on so we can see what’s happening?

Here is my current graph:

Here is an annotated image:

I realize my Element.GetParameterValueByName is not connected to anything. This is because when I connected it to the FilterByBooleanMask node the SetParameterValueByName node displayed the error “Dereferencing a non-pointer.”

The “ScheduleView…” object is the actual element. The name obviously doesn’t have that piece included. You get the ViewName but you don’t do anything with it. You filter the actual views for the ones that aren’t templates (good) but then you use the element as the name (bad). You want to get the ViewName after you’ve filtered your views and use that string to rename them.

Excellent, thank you! After moving the GetParameter node to after the list filter node, then connecting the GetParameter node to the object from string node, it worked.

Adjusted graph: