You are on page 1of 1

Ranges and sequences can be helpful in many situations by providing a list of numbers for an

input. In this exercise file, there are four Number nodes containing the numbers 2, 4, 6, and 8. In the
node Library, expand Core > List. There are three Create nodes under List: List.Create, Range, and
Sequence. Add a Range node and a Sequence node to the workspace. These nodes only work with
numbers and letters. For the Range node, the inputs are start, end, and step. So you can specify the
start and end points for a range of numbers or letters, and then specify the space between each item
in the list. Take note that the step must be a numerical value, regardless of whether numbers or
letters are used. For this example, connect the Number node with 2 to the start and step
inputs. Then connect the Number node with 8 to the end input. This creates a list starting at 2 and
ending at 8. The numbers are then spaced by 2. Therefore, the list is 2, 4, 6, 8. The Sequence node
is similar, but you can specify the start and the amount, or how many items you want in the list. Then
you can specify the space between the items with the step. For this example, connect the Number
node with 2 to the start and step inputs. Then connect the Number node with 8 to the amount
input. This creates a list starting at 2 with 8 total items. The numbers are also spaced by
2. Therefore, the list is 2, 4, 6, 8, 10, 12, 14, 16. Additionally, you can use code blocks to create
ranges and sequences. Double-click the canvas to place a Code Block. To create a range, you must
enter the start value, end value, and step value, each separated by two dots. For example, enter
2..8..2. This creates the same list as the Range node.Create another Code Block. To create a
sequence, you must enter the start value, the number of items, or amount, and the step value, each
separated by two dots. The only difference for a sequence is that you also have to place the number
sign (#) before the amount value. For example, enter 2..#8..2. This creates the same list as the
Sequence node. You can adjust the connectors and adjust the numbers in the code blocks to get a
better understanding of how ranges and sequences are created. Lastly, you can use a Code Block
to create a range with a specified amount of values. For example, create another Code Block and
then enter 1..10..#5. This creates a range from 1 to 10, but instead of spacing the values by 5, the
number sign (#) tells Dynamo to create 5 items. So as you can see, using DesignScript in code
blocks provides a little more flexibility. However, you may want to start with the nodes to help you get
an understanding of ranges and sequences.

You might also like