Dynamo Range

Greeting to you all,

I am trying to make a range in Dynamo, this to start from (0) and ends with (10), with a step value of (3), if I write in the code block the following
0…10…3 it will generate for me 0,3,6,9
what if I want always to include the last value to get (0,3,6,9,10). it is really important as most of the time you do not get the end value of your range as the step value accumulation will not reach it.

Any suggestion, Many Thanks in advance

Firas

Add a List.AddItemToEnd node and a List.UniqueItems node. Or a single in line function via design script (place the nodes, select them all, right click the background and chose node to code to get started).

2 Likes

thanks dear!!! the one I was forget is the"List.UniqueItems"

Many thanks dear

1 Like

a little python perhaps
Start=IN[0]
Setp=IN[1]
End=IN[2]
List=
while Start <= End:
List.append(Start)
Start+=Setp
if End not in List:
List.append(End)
OUT=List

Capture

2 Likes

many thanks dear