Loop, input different variables in succession

Hello everyone,

What I have is an elaborate script for getting and setting multiple parameters from wall types to certain detail components. As variable input I use the Type Mark parameter. I have 35 different wall types (Type Mark parameter ‘W01’ through ‘W34’). 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 35 type mark parameters in succession. So, after finishing the script running on input W01, automatically continue with W02 as input, etc.

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

Thank you in advance!


See if it helps:





I found these posts as well. However, my problem seems to be simpler than this? I merely want the script to rerun with a different/the next parameter value, and again, and again… Anyone?

From my limited understanding of your description, you don’t need loops.

Sort the elements (using SortByKey or SortByFunction) by the required parameter (Type Mark in your case)

This should give you a list of elements arranged sequentially by parameter.

I am sorry if my description is not very clear. I will try to explain. I have a visual program which gets and sets some parameters. It gets some wall parameters and sets these to some detail components. For my post it is not very important to go into detail as I have a more general question. This visual program works perfectly in itself

Now, I have 35 different wall types and it is important to input these wall types one by one in the visual program. So, by using its type mark I input one wall type into the visual program: e.g. the wall type with type mark “W06”. The program runs and delivers the expected results.

Now, I have 34 wall types to go! I put in “W07” and again run the program with good results. Etcetera!

It would be great to automate this input of W01 all the way through W35, so I only have to run the visual program once. That’s why I was thinking ‘loop’ but maybe you all have some other ideas?

You could create a list with all walls having the same Type Mark grouped into separate sublists.

In the example below, there are 3 sublists (sublist 0 has Type Mark W1, sublist 1 has Type Mark W2 and sublist 2 has Type Mark W3)

You will have a list with 35 sublists. I suppose, you’d be able to take this further without loops

File: WallTypeMarkGrouping.dyn