Set multiple templates to view, one after another

Hello Dynamo Community!
This is my first post but it for sure won´t be the last one! I´m pretty new to Dynamo and Revit and i`m having fun experimenting and lerning. I´m having trouble with my first script and would appreciate your help.

Task:

  1. find all views with specific view template
  2. set new view template (e.g.: wall_views_filter)
  3. set another view template (e.g.: wall_views)

Reason:
Our worklflow is to have a filter-template for our view types. For example, we have a wall_views template and a corresponding wall_views_filter template. We first apply the _filter template to our views and then the other template in wich filters are not “included”. So if i want to make changes to the _filter template i would like to update all wall-views with the wall_views_filter template and set them back to wall_views in a last step.

I found a script here in this forum that does part 1 and 2. But i can`t figure out how to set another view template after. Here is what i have so far.

Thanks in advance!

Kind regards, Gerhard

Welcome to the community!

The Views.SetViewTemplate node should pass the list of views through to the node output.
What happens when you chain a second SetViewTemplate to the first?

You may need to include separate transactions between applying each template.

Hy Robert, thank you!

If i make a second chain like this it skips the “test 2” template, and directly sets the template “test 3”. So it skips the template that would be my _filter template, so no filters are applyed.

Thanks Nick, but i have now idea how to do this. My result is a node output of one view, how to start a seperate transaction from there?

There are nodes for this. You need to apply each template within a pair of Start/End Transaction nodes.

It´s working :grinning: Thank you very much!