Can i use code block to do something loop automatic(as slider)

i have made a program and it nearly cost 4 minutes to run once,
Every time I set the parameters up to 50mm,by integer slider

Troublesome things: Often forget time to run, and easy to set wrong parameters.

so if can i use code block to set the parameters of equal increase,and run the program each time.

i’ve try the code,possible grammatical errors,
or it may not be possible to implement this function.

can you help me.
thanks !

What is the end goal, and why do you wish to do it iteratively?

1 Like

i am testing the room height, from 2200mm to 3200mm,
using BoundingBox. and it can only check one height at once.
so i want to make a loop,can do the program many times and automaticly(each time with diffrent heigth)

i’ve explained the picture.
and hope can make the group_2 works
needs your help thanks

Dynamo is not much for loops, if I were to do it, I’d use Python like follows:


I think, would you like.

sorry, my picture is just a simple sample.
in my program,only one parameter can be run at a time

According to your method, a lot of parameters will be provided at the same time(it is a list), resulting in failure of operation.

You could attempt to use the “loop-while” node or consider looking into the package called “Optimo” if you’re looking for generic optimization algorithms.

the picture is party of my working screen.
The loop is based on the results of the last run,not list

According to your suggestion,i wll try the node later ,thanks