By the end of today
- Describe what a computer does — three operations, repeated, with nothing added.
- Say what a script is — and why a designer already knows the form.
- Name the five moves that make up every script you will meet this semester.
- Trace a loop by hand and predict what it prints before running it.
- Read a script the agent wrote and decide whether to run it.
A computer does not understand your project. It holds a list of steps and a finger on its place in the list.
Everything that looks like judgment is built on top of that, by doing it a few billion times a second.
Three operations, forever
- Fetch — read what is in a labeled box.
- Do — one operation: add, compare, join.
- Store and step — put the answer somewhere, move down one line.
- So: it never guesses. An ambiguous instruction does not come back as a question. It comes back as a confident wrong answer.
- And: it never tires. The thousandth repetition is as exact as the first.
Three kinds of instruction
| A recipe | A Halprin score | A script | |
|---|---|---|---|
| Who runs it | A cook | A group of people | A machine |
| Ambiguity is | Tolerated — “season to taste” | The point — the score invites variation | Fatal — it stops, or does the wrong thing exactly |
| Runs again | Roughly the same | Deliberately different | Identically, every time |
| Leaves behind | A meal | An event, and a record of it | Files, and a readable trace of how they were made |
A script is a process, drawn.
A plan abstracts a place so someone else can build it. A script abstracts a procedure so a machine can run it. Same move, different subject.
scale = 20
Put a value in a labeled box so later lines can use it.
for f in files:
Do the same thing to every item in a set, one at a time.
if w > 1920:
Take one branch or the other, by a test you wrote.
def encode(p):
Name a group of steps so you can run it again elsewhere.
img.save(out)
Touch the world outside the script: files, folders, the network.
# Grasshopper fills these three before line 1 runs.# You renamed the inputs; the sliders supplied the values. rise = 1.0 # from a sliderrun = 12.0 # from a sliderlimit = 8.33 # from a slider — the ramp limit slope = rise / run * 100 # 8.333333333333332
slopes = [] # an empty list to fill for r in rise: # one value at a time slopes.append(r / run * 100) a = slopes # three in, three out # add a fourth number to the panel and this still works.# the loop is what stops the script caring how many.
faces = [(1, 20), (1, 12), (3, 10)]steep = 0for rise, run in faces: slope = rise / run * 100 if slope > 8.33: steep = steep + 1print("steep:", steep)
| faces | — |
|---|---|
| rise, run | — |
| slope | — |
| steep | — |
Press Step to move the finger down one line.
if slope < 2: # under 2% — will not drain band = "ponds"elif slope < 5: # 2–5% — comfortable band = "good"elif slope <= limit: # up to 8.33% — accessible route band = "accessible"else: band = "too steep" # the judgment is not in the "if". it is in 2, 5 and 8.33,# which a person chose, rounded, and typed once.
# Script-Mode — what you have been writing all along.slopes = []for r in rise: slopes.append(r / run * 100) # ─── click “Convert To GH_ScriptInstance” ─── class MyComponent(Grasshopper.Kernel.GH_ScriptInstance): def RunScript(self, rise, run, limit): slopes = [] for r in rise: slopes.append(r / run * 100) return slopes # the three names you typed on the component are the three# parameters of a function. they always were.
rise · run · limit
TypeError: unsupported operand type(s) for /: 'str' and 'float' slope = rise / run * 100 # what — it tried to divide text by a number# where — the line it quotes back to you# why — a panel fed "1.0" into rise as characters, and no# Type Hint was set, so it never became a number# fix — right-click the input and give it a float Type Hint
import Rhino.Geometry as rg # 5 · reach outside LOW, MID = 2.0, 5.0 # 1 · name def band(slope): # 4 · bundle if slope < LOW: return 0 # 3 · choose elif slope < MID: return 1 elif slope <= limit: return 2 else: return 3 bands = []mesh.FaceNormals.ComputeFaceNormals() for n in mesh.FaceNormals: # 2 · repeat slope = (1 - n.Z * n.Z) ** 0.5 / n.Z * 100 bands.append(band(slope)) a = bands # 5 · hand it downstream
That is what the agent hands you.
Not pseudocode, not a sketch — a file like that one, in about twenty seconds, from one sentence you wrote. Reading it is the skill that is left.
Writing it yourself vs. directing an agent
| You write it | The agent writes it | |
|---|---|---|
| Time to first version | Hours to days | Seconds |
| What you must know | Syntax, the library, the error messages | What should happen, and how to recognise it |
| Still your job | All of it | Specify · read · test on real files · decide to keep it |
| Risk | It does not run | It runs confidently on the wrong files |
| Who carries it | You | Still you — it has no stake in your work |
Before you trust it
- Where do the thresholds live? On sliders you can reach, not typed into the middle of the code. The numbers are the design decision.
- Are both sides in the same units? A ratio (
0.0833) compared against a percentage (8.33) reports every face as flat and never errors. - Which way does the comparison run at the edge?
>against>=is the difference between a compliant ramp passing and failing. - What does it change? In Grasshopper, nothing until you bake. Find the step that writes before you take it.
- Then: measure three spots by hand. Four minutes, and it is the only part that proves anything.
Where this goes next
- The agent runs a loop — read the context, plan, write a file, run it, read what came back, revise. Move 2 with a very large body.
- Which is an old diagram —
y = f(y), the cybernetic loop, with a language model in the box. Cybernetics and Design - So your leverage is the context — what it reads before it writes. That is the Context Is Design session, and most of this course.
You are not learning to write scripts. You are learning to read them.
A profession that already reads drawings, details and specifications for a living is better prepared for this than it thinks.
Before next week
- Workshop — Reading a Script — in class, now, in Grasshopper. Predict, then run.
- D1 — workflow audit — one recent project drawn as a sequence of steps, with the friction marked. This is the raw material for your Part II project.
- AI Fluency — generative AI fundamentals; capabilities and limitations. Watch before next session.
- Check your install — Rhino 8 opens Grasshopper, the agent runs, Git knows your name.