Assign same parameter to all elements in sublist

Hello!

I’ve grouped some elements based on key parameter, how can I assign same numerical value to each sublist?
In this example I have 4 pipes, they are sorted in 3 sublists, so all pipes in 0 List would get value 1, all pipes in 1 List would get value 2 and so on.
I found example of Code Block that makes number sequence, but it seems that it works with lists, each sublist resets numbering.
Is there a way to rewrite the Code Block? Or there is other way to assign sequential numerical value to all elements in each sublist?

Hi @r.buzs

seq = 1..DSCore.List.Count(x);
amount = DSCore.List.Count(x<1>);
output = DSCore.List.Cycle(seq<1><2>,amount<1>);
1 Like

That’s exactly what I was looking for, thank you!

1 Like