Looping into different inputs successively

Bonjour à tous,

What I have is a graph used to get and set multiple parameters for rooms. As variable input I use the Name of the room parameter I want to inquire. I have 8 different rooms names . At the moment, I input this parameter one by one in the script, which obviously takes quite some time. I would like Dynamo to input the 8 type mark parameters in succession. So, after finishing the script running on input “Room 1”, automatically continue with “Room 2” as input and so on.

So, my question in general would be how to do such a ‘loop’?

Merci d’avance!

You simply need to collect all room elements in your project and get their Room Name parameter value. Then use that list as your input instead of a single name. (You shouldn’t have to sort them in order but you can if you want.)

You will most likely have to make a few adjustments to the rest of your graph so that it runs correctly on lists, but that’s really all there is to it.

1 Like

Thank you Nick for helping me, I think that I don’t have the choice, I must find a way to rearrange all my graph using your tip.
The only thing that scares me is that, for each room: my old graph had to select, the boundaries of it, and find the intersection with the walls (to calculate areas of contact).
I’m worried that using lists and your tip will do a very big mess, and the graph will be lost, associating the wrong intersections for walls, and calculating wrong areas etc. …

Here is my graph if you want to have a look at it.Muretrevetement1.dyn (124.2 KB)

Your other option is to do the same thing but in Python.

I noticed a lot of your graph is being repeated when it doesn’t need to be. Your graph will be much more efficient if you set it up to use lists instead of breaking each item out separately. It will also allow you to use the same graph on multiple projects without having to add or remove pieces. Look into List Levels and controlling list structure for multiple lists.

I am stuck for a week now, I think I’m going back to my programming courses…
I will try the first solution too, but I think that I will get lost when matching each item.
thx! :slight_smile:

Most of the time it’s as easy as changing the lacing. Try making the changes and let us know how it goes.