I am trying to duplicate selected views with a specific Prefix and then apply a selected View template to all the new views.
My script is working, but it only applies the selected view template to one view.
I upload the script if anybody can help me with this issue.
Duplicate_Views and Apply View Template.dyn (65.2 KB)
It’s because you’ve given it a list of 3 views, but only one template. You could match up the input list lengths by using ‘ListOfRepeatedItem’ or ‘List.Cycle’, you can adjust the @ Level inputs on the node to suit, or the easiest would be to just set the lacing to longest.
The current auto lacing has decided on ‘shortest’, which means it will stop when it reaches the end of the shortest input list, and not process anything from inputs with longer lists. Longest lacing will continue until it reaches the end of all input lists, and if one list is shorter, it will apply continue on with the last value in that list. Because your template type is a list of 1, it will just apply this same template to all input views.
Thank you so much, putting the input to the longest lacing worked!