Filter list of ViewTemplates and View Types by name

We typically have a single Revit template in our office that contains view templates for both Architecture and Interior Design. It has been requested that when our project is only Architectural that we delete the viewtemplates and view types only needed by Interior Design and vise-versa.
Both views types and view templates names start with either AR or ID so this shouldn’t be too difficult but I’m struggling to access both element types.
Here’s what I have so far. Any advice would be appreciated.


Hello there!
First, try “cleaning” inputs and outputs according on what u need, so u can have a more organized script.
For example, when u get all view elements, u are also getting the schedule views, wich generates the error in the GetParameter Node, as schedules don’t have that parameter.

Regarding the List.Contains Node, see that u are comparing view elements with strings, wich doesn’t make much sense. U should get the view names and use a String.Contains before the Filter by Bool:

Let me know if this approach helps you!

1 Like

Thanks Matias. That was so much cleaner than my original attempt.

Any chance you know how I could list the element types for ViewFamilyType? I’m trying to list the view types and then again delete the ones who’s names begin with ID or AR. You can see the types listed correctly in the ViewFamilyTypes node but then when connected to the All Elements of Type node they just show the id#. I’d like to be able to filter these by their name shown in the ViewFamilyTypes node.


Don’t quite understand what you mean, or what the issue is. The element.Name node should still retrieve the name of the type. There should be no problem about showing the Ids

1 Like

Yes you are looking at the list of Elements, they are all “ViewFamilyTypes” that is why the next node, Element.Name is used to get the name of these individual Elements.

I’m trying to filter the list shown on the left for the ID or AR designators but when I attach the “All Elements of Type” node it shows the id# not the ViewFamilyTypes names as shown in previous image in the left red box.

This is what I get when I use the “Element Types” node.

Any ideas how I can get the list to show the names?

you literally have the node you need in this screenshot, “Element.Name”.
Is this what you mean?

Jeez. Thank you so much.
Clearly I’m starting to learn but making rookie mistakes.

Thanks for help.

1 Like