I have a list of elements filtered by a parameter. I want to take all the elements that have matching parameters and assign a value to a different parameter. That part is easy enough. The issue I have is that the list will vary every time I run the script. So I want to create a loop to run until the list is empty. I will post a screen shot once I can get but maybe somebody can help me in the meantime. Thanks.
Please send elements showing what you’ve tried and searched and illustrating what you aim so we can quickly understand what it’s all about. Thanks 
I have this DesignScript Loop While reference in my bookmarks that could help to get started:
http://dynamobim.org/forums/topic/how-to-run-a-loop-on-a-dynamo-graph/
And also this example of LoopWhile using a custom node as a function:
But it don’t know (yet) if this could work in your case ![]()
Edit: here is another good example:
http://dynamobim.com/forums/topic/loopwhile-for-a-variable-x-need-output-for-a-variable-y/
That last post got me what I needed. Thanks.
@coastguard09 List.GroupByKey might be worth exploring.
If I’ve properly understood, you most likely can avoid Loop While or/and a Custom node
Try replacing your custom node with these…
It’s amazing how much simpler these scripts could be. Thanks very much. Now I need to get the last part to run on each list individually. Thanks. I’ll post when I get it, unless someone beats me to the punch.
I just increased my step amount to 1 and everything works beautifully. Thanks fellas.
Hint: Start by changing lacing to Longest
[/quote]
Hint: Start by changing lacing to Longest
I am going to attempt to explain this. When I switched the lacing to longest it assigns a unique number to each element in all the lists (or list of list? I’m new to all of this). When I leave it to shortest, it takes each list and assigns the same value to each element in one list, then moves to the next list and does the same thing, Which is what I want.
I didn’t realize that all I needed to do is plug in your solution and it would run through all the list. I was for sure it had to be more complicated than that.
@coastguard09 Please see solution in my topic List.count for list level 2
hello there!
both your links are no longer found…says 404…
can you please repost somehow?
thanks!




