Repeat comand n-times

Hi!
I want to replace curtain wall panels with others of various colors and openings, so I created a script in which you choose the panels to replace and the new ones, dividing the selected elements according to the new types to be placed. I get two lists (selected panels and new panels type) that I would like to combine between them to change the panels, but connecting them to “FamilyIstance.SetType” the command changes the panels only with the first type. I could split the lists and repeat the “FamilyIstance.SetType” command as many times as I need, however I would like to create a script that allows “FamilyIstance.SetType” to be repeated n-times. Help me, please!

On the FamilyInstance.SetType try using @L2 and @L1 for the input list levels.

Thanks, it works!
But the script doesn’t shuffle the panels. What is the mistake?

Hard to see as the before and after data structures are not exposed, but perhaps a wap your list.flatten and your list shuffle nodes.

the swap worked
Thanks!!!

1 Like