Dynamo (List decreases)

Good afternoon!
Please tell me why the list from -10 to 0 decreases after the code block?

If statements don’t have lacing, so you’re forced into shortest in all cases.

Upgrade to a newer Dynamo build and use a node to take advantage of the upgraded IF node.

Do I understand correctly that dynamo 2.10.1 does not solve this problem?

It’s not so much a “problem” as it is just how IF statements work. If you want to use an IF statement with varying list lengths, you have to modify the logic to return index values rather than the indexed sublist itself:

Also, not sure if this was intentional or not, but sequences (n..m) are already lists - no need to put them inside another list unless you want nested lists.

1 Like

As Nick stated, this isn’t a problem but how the code you wrote executes. The output is what one who understands designscript would expect.

That said, best to get into a supported build. I believe that the earliest at the moment is 2.12, but better still a modern build as 2.12 is likely only supported for a few more months as host applications (i.e. Revit, Civil 3D, etc.) are released in the spring.