Loop in Dynamo

Hello everybody!

I have some “Megawall elements” in Revit and each of them have 2 string-type parameters (“Inner graphic size” and “Outer graphic size”). My goal is to create numbering out of all these parameters (depending on their values) and set these numbers back to “Megawall elements” (to another two parameters called “Inner panel number” and “Outer panel number”).

So that the script will generate numbers 1, 2, 3, 4 for my 4 unique parameters 984x2472h, 964x2472h, 990x2480h, 970x2480h and then these numbers will be assigned to all the elements if parameters coincide.

In addition to that, parameters “Inner graphic size” and “Outer graphic size” can coincide within different “Megawall elements” and numbers for matching elements need to be the same. The scheme for this procedure has been created in Dynamo and works just fine in a manual mode (when I change “Manual index switch” manually). To do this procedure automatically I need to make a loop instead of “Manual index switch”. Dynamo internal loop node seems to be doesn’t work as I need: it outputs just the final result of the loop (number 3 in my particular example) but I need all the intermediate results to be processed one after another (0 then 1 then 2 and then 3). Are there any way to do that (maybe using Python)? I know it should be possible to do that very easy but so far cannot solve this problem.

Many thanks for help in advance!


Have a look at this post for some ideas. This is done using design script but you can also do it with python if you’re familiar with it.

Renzoj14, thanks for advice!

1 Like

No problemo! don’t forget to mark this port as closed if you have found the naswer to you question.