Lesson 3.1Lesson 3.1 · Data Trees & List Management
Lists & Indices
Data as one ordered stream - and how every component reads it by position
Almost every Grasshopper problem you will ever have is really a question about which item sits at which index.
Grasshopper does not move one thing at a time - it moves streams. A single wire can carry one number or ten thousand points, and every component quietly asks the same question: which item, in what order, at which position?
Get the list right and geometry falls into place. Get it wrong - an item shifted by one, a stream reversed, a count off by a single unit - and the shape looks almost right in a way that is maddening to debug. This lesson makes the list, and its index, something you can see and control.
Length N -> last index N-1. Series knows the step; Range knows the ends. Always open a Panel.
The wire carries a list, not a thing
When you drop a slider on the canvas and wire it into a component, it feels like you are passing a number. You are not - you are passing a list that happens to have one item. That reframing matters, because the moment you divide a curve, draw a grid of points, or copy an object, that single wire starts carrying many items at once, and every downstream component treats the whole stream at the same time.
A list in Grasshopper is simply an ordered collection of items travelling down one wire. Order is the whole point. The list ["door", "window", "wall", "roof"] is not the same as ["roof", "wall", "window", "door"], even though both contain the same four things - because components read them in the order they arrive. When you Divide Curve into 10 segments, you get a list of 11 points in a definite sequence from the curve's start to its end. That sequence is not decoration; it is data you will rely on.
Hold the mental image the whole course leans on: one flowing list, left to right, item after item. Master the single list and the data tree in the next lesson stops being frightening - a tree is just a filing cabinet of these lists.
A wire never carries 'a number'. It carries a list. Sometimes the list has length 1.
Indices start at zero (and why that keeps biting you)
Every item in a list has an address called its index, and in Grasshopper - as in almost all programming - indices start at 0, not 1. The first item is index 0, the second is index 1, and a list of 5 items has indices 0 through 4. Its List Length is 5, but its last index is 4. That off-by-one gap between length and last index is the single most common beginner stumble, and naming it now will save you hours.
The List Item component is how you pull one item out by index: feed it a list and an index i, and it returns the item sitting at that position. Ask for index 0 and you get the first; ask for the length (say 5) and you get nothing, because there is no item there - you have walked one step off the end. Want the last item reliably, whatever the length? Feed List Item a negative index (-1 wraps to the last item) or compute length - 1 with a subtraction. Both are honest habits; guessing the index is not.
List Length answers 'how many?', and you will wire it into more things than you expect: to place the last object, to size a range, to check that two streams are the same length before you combine them. When something downstream breaks, the first question a seasoned user asks is not 'what's the shape?' but 'what's the length, and is index 0 what I think it is?'
Making lists on purpose: Series and Range
You will constantly need a list of numbers to drive something - counts, spacings, parameters from 0 to 1. Two components make them, and confusing them is a rite of passage.
Series builds a list from a start, a step and a count: start 0, step 3, count 4 gives [0, 3, 6, 9]. You control the spacing directly and the count tells it when to stop. Reach for Series when you know 'give me 20 values, each 4 units apart'.
Range divides a domain (a from-to interval) into a number of equal steps: the domain 0 to 10 with 5 steps gives [0, 2, 4, 6, 8, 10] - note that N steps produce N+1 numbers, because you get both fences and the posts between them. Reach for Range when you want 'evenly spaced values across this interval', especially the classic 0-to-1 parameter list that drives colours, heights, or positions along a curve.
The honest rule of thumb: Series when you know the step, Range when you know the endpoints. Both hand you a clean list; which one you pick decides whether you think in increments or in bounds. Feed either into Point, Move, or Evaluate Curve and you have turned a rule into a rhythm of geometry.
Series = start, step, count. Range = domain, steps -> gives N+1 numbers. Off-by-one lives here too.
Reshaping the stream: Shift, Cull, Reverse, Sort
Once you have a list, a handful of components reshape it - and each one changes the indices, which is exactly why they solve so many problems and cause so many.
Reverse List flips the order: [0, 3, 6, 9] becomes [9, 6, 3, 0]. Useful when a curve was drawn the 'wrong' way and your points march from the wrong end.
Shift List slides every item along by an offset, optionally wrapping the ends around. Its quiet superpower is pairing each item with its neighbour: shift a list of points by one and combine it with the original, and you have the start-end pairs for every segment of a polyline - the trick behind connecting dots into lines.
Cull removes items. Cull Pattern takes a repeating true/false mask (True, False) and keeps only the trues, thinning a list to every other item; Cull Index drops specific positions. This is how you punch holes in a grid or skip every third louvre.
Sort List reorders items by a key - a second list of numbers that ranks them. Crucially, Sort List can carry passenger lists along: sort a list of distances and let the matching geometry ride in the same order, so your objects end up arranged nearest-to-farthest. That pattern - sort geometry by a measured value - is the engine behind attractor effects you will meet later.
The common thread: all four rewrite which item lives at which index. After any of them, re-ask the length-and-position question before you trust the next step.
Lists at work: connecting dots into a real thing
Let's tie the pieces into one small workflow you'll do a hundred times, because seeing lists earn their keep makes the abstraction concrete. Say you want a zig-zag screen: a row of points, connected in order, then given depth.
Start with a Range on the domain 0-to-1 with, say, 12 steps - that's 13 evenly spaced parameters. Feed them into Evaluate Curve along a base curve and you have 13 points marching from one end to the other, in a definite order. So far, one clean list.
Now connect them. A Polyline through the list draws a single line visiting the points in sequence - and here the order you spent this lesson mastering is doing the work; reverse the list and the polyline still connects the same dots but the direction flips, which matters the moment you offset or extrude it. Want individual segments instead of one polyline? This is where Shift List shines: shift the points by one, then feed the original list and the shifted list into a Line component, and each point pairs with its neighbour to give you 12 separate segments. That neighbour-pairing trick - born entirely from list order and a shift - is one of the most reused moves in all of Grasshopper.
Finally, thin it: drop a Cull Pattern (True, False) before the polyline and you've halved the density to a sparser rhythm, no rewiring required. Notice what just happened - you designed a system (points, order, connection, density) whose every knob is a list operation. That is the whole promise of the last lesson made tangible, and it's built entirely from the handful of components you now know.
List Item
Retrieves the item at a given index from a list
Feed it a list and an index i. Index 0 is the first item; -1 wraps to the last. The everyday way to grab one thing out of a stream.
List Length
Reports how many items a list holds
Answers 'how many?'. Remember: a length of N means valid indices 0 to N-1. Your first diagnostic when a stream misbehaves.
Series
Builds a list from start, step and count
You set the spacing directly. Use it when you know the increment and how many you want.
Range
Divides a domain into equal steps
N steps yield N+1 numbers. Use it for evenly spaced values across an interval, e.g. the 0-to-1 parameter list.
Shift / Cull / Reverse / Sort List
Components that reshape an existing list
Shift slides, Cull removes, Reverse flips, Sort re-ranks by a key. Every one of them changes which item sits at which index.
Workshop — build and reshape one honest list
Nothing here needs fancy geometry. The goal is to _watch_ a list change as you reshape it, using a Panel as your window into the stream. This single habit - always look at the data - is what makes list management click.
Rhino + Grasshopper (free trial or student licence). One curve. A Panel and a Param Viewer docked where you can see them.
Goal: see indices, length and list operations with your own eyes Inputs: Rhino + Grasshopper, one curve drawn in Rhino Time: ~30 minutes
- 1Drop a Series (start 0, step 1, count 10) and wire it into a Panel. Read the ten items and their positions. Now change the count to 5 and watch the Panel - you just resized a list live.
- 2Add a Curve parameter, reference your Rhino curve, and feed it into Divide Curve with count 10. Wire the output points into a Panel. Notice you get 11 points, in order from the curve's start - confirm the off-by-one with your own eyes.
- 3Wire the points into List Item and try indices 0, 3 and -1. Bake or preview each. Confirm that 0 is the start point and -1 is the end point.
- 4Insert a Reverse List before List Item and repeat. The same index now returns a different point - proof that operations rewrite the addresses.
- 5Finally, add a Cull Pattern with the mask True, False on the points, and preview. You have thinned the row to every other point. Read the new List Length and note how many survived.
You’ll walk away with
A small definition where a Panel shows a live list, plus a short note (three lines) recording: the length before and after Cull, which point index -1 returned, and what Reverse did to index 3. That note is you learning to read data.
Three altitudes on the same idea
Read the band that fits you — or all three.
Lists are how a facade becomes editable rather than drawn. A row of mullions, a stack of floor levels, a run of shading fins - each is a list you can lengthen, thin with Cull, or re-rank with Sort. Thinking in ordered streams is what lets you change a building's rhythm by editing one input instead of nudging a hundred objects.
Pattern and repetition are list problems in disguise. A slatted screen, a tile layout, a shelving rhythm - all are lists whose spacing (Range), thinning (Cull) and ordering (Sort) you control. Learn to reshape the stream and you can retune a whole decorative system, then send a clean, indexed set of parts straight to a CNC cut list.
This is the fluency that separates people who 'know some components' from people who can actually build. Indices from zero, length versus last index, Series versus Range - these are small ideas, but getting them into your fingers is what makes every later module (trees, attractors, panelization) feel easy instead of mysterious. Drill them until they are reflex.
“A slider just passes one number, so lists are an advanced topic I can skip for now.”
Do it yourself
Reason each one through - say the index out loud.
- 1A list has 8 items. What is the index of the first item, and of the last?
- 2You want the final object in a stream of unknown length. What index do you feed List Item?
- 3Series start 2, step 5, count 4 - write the list it produces.
- 4Range on domain 0-to-1 with 4 steps - how many numbers come out, and why?
- 5You shifted a point list by 1 and combined it with the original. What geometry does that set you up to build?
The one line to carry out
Peer-reviewed journals & authoritative standards
- 01Mode Lab — The Grasshopper Primer (Third Edition) — grasshopperprimer.com (free online edition), 2020.
- 02Rhino Developer — What are data streams / lists — Robert McNeel & Associates, 2026.
- 03Grasshopper Docs — component reference — grasshopperdocs.com, 2026.
- 04Woodbury, R. — Elements of Parametric Design — Routledge, 2010.
One list is enough until it isn't. The moment you divide many curves, or grow a grid of points across rows and columns, a single flat list can no longer say which items belong together. That is the exact problem the data tree solves - and it is next.
The author
Amogh N P
Architect, interior designer, and creative polymath. Studio Matrx began in his notebooks — his vision of design made honest, useful, and open to everyone. Its Academy is written and taught in his memory, and free, forever.
More about Amogh →