Skip to main content
The agent can write Rhino Python scripts for you, run them in Rhino, and fix errors as they come up. This example covers the workflow plus three practical patterns: generating massing studies, building a custom analysis tool, and producing a flocking simulation. Time: 12 minutes You’ll need: Runchat for Rhino installed and signed in

Open the example workflow

Make a copy of this workflow in your account to follow along.

Pick a model

Before you start, pick an agent model that matches the complexity of what you’re building:
  • Gemini 3 Flash: solid all-rounder for simple utility scripts
  • Claude Opus or Gemini 3 Pro: for anything involving geometry logic, multiple constraints, or scripts longer than ~50 lines
Flagship reasoning models produce significantly better Rhino Python than fast models. If a script involves more than a few lines of logic, use a flagship model from the start. It’s faster than iterating through errors with a cheaper one.
To change the agent’s model, click the chat title at the top of the Agent panel and choose Model (it shows the current model name) to open the model picker.

The simple path

Add a Code node to the canvas, choose Rhino Python from the language menu on its toolbar, select the node, and ask the agent for what you want. For example: add a box with sliders for width, depth and height. The agent writes the script and sets up parameter inputs (sliders) on the node. Click Run in Rhino on the node toolbar to execute it. If the script errors, paste the error back into the composer. The agent reads Rhino’s execution status and produces a diff to fix it. For more on the Code node and language modes, see the Code node reference.

Pattern 1: Plan before you generate

For non-trivial scripts, don’t ask for the code immediately. Tell the agent not to change the canvas yet, and have a conversation about parameters and constraints before any code is written. Example. Before asking for a tower generator, ask:
The agent will suggest things like number of floors, floor-to-floor height, floor plate thickness, core dimensions, column placement, taper. Review and refine. Once you know what you want, say “please execute this prompt”. If the agent needs permission to edit or run nodes, it asks with a Permission needed card. This stops the agent from making style assumptions and keeps the first version focused.

Pattern 2: Build a small custom analysis tool

The Code node isn’t just for generating geometry, you can build quick one-off analysis tools for things that would otherwise need a Grasshopper definition. For a floor area calculator:
  1. Add a Code node and choose Rhino Python from its language menu
  2. Select it, prompt:
  1. Click Run in Rhino, pick a surface, set the floor height
  2. Check the console for the total
Simple utility scripts like this work fine on cheaper models. Reserve flagship models for complex generative scripts. You can extend with follow-up prompts:
  • “Keep all the contours visible after running”
  • “Highlight any floor below a minimum area”
  • “Write the floor areas to a CSV”
  • “Add a label showing each floor’s area on the model”
All purely through prompting. No wiring.

Pattern 3: Generate from reference images

Pasting a reference image into the composer gives the model far more context than words alone. The agent infers form language from the image, cylindrical towers, curved Boolean subtractions, wedge chamfer cuts, just from one good reference. For a random massing generator:
  1. Add a Code node, choose Rhino Python from its language menu, and select it
  2. Paste a reference image of the kind of massing you want into the composer
  3. Prompt: A random massing generator that produces a grid of options like this image.
  4. Run when the agent finishes writing, pick parameters when Rhino prompts
Iterate by adding complexity in follow-up messages:
  • First pass: “random massing generator, grid of options”
  • Next: “let’s combine different primitives like in the reference image”
For small tweaks (bigger grid, taller masses, colour options), the agent makes targeted line-level edits. Open the code editor (Edit code, or press E) to review the diff, then click Accept changes or Undo changes. Cheaper than full rewrites.

Pattern 4: Build, optimise, and extend

For a complete loop on a more demanding task, like a flocking simulation, the pattern is:
  1. Plan first. Tell the agent to plan without changing the canvas, and chat with Flash about requirements and implementation options before any code is written.
  2. Build with Opus. Change the model to Opus and ask it to build your chosen approach. You get a code node plus sliders wired to the parameters (agent count, separation, alignment, cohesion). Big builds cost around 1,000 credits.
  3. Swap sliders for an Eto Forms GUI. Tweaking sliders in Runchat gets old. Ask the agent to add an Eto Forms dialog inside Rhino and remove the unused sliders.
  4. Fix errors inline. Paste errors back into the composer. The agent reads the code and replaces the broken lines. Two or three cycles is normal.
  5. Extend behaviour by asking. “Make the agents responsive to a mesh.” The agent will ask clarifying questions (attraction or avoidance?) and add the feature once scoped.
  6. Optimise for scale. Ask the agent to optimise for 10,000+ agents. It will bypass direct Rhino object management, implement its own viewport drawing, and restructure hot paths.

Using screenshots to fix visual issues

When a script runs but the output looks wrong, screenshot the Rhino viewport and paste the image into the composer. The agent can see what’s wrong visually and fix the logic. In a tower generator example, columns were sitting right next to the core. A screenshot plus “the structural logic is odd, columns are too close to the core” was enough for the agent to rewrite the placement logic.

Saved scripts

The RunchatScripts panel in Rhino
Every script the agent generates during a session is saved and accessible in Rhino. Open the script browser with the RunchatScripts command:
  • Re-run any previous iteration
  • Copy the code to share with colleagues
  • Roll back after a change you don’t like
Return to the main Runchat panel any time with the Runchat command.

Useful patterns

  • Add a GUI instead of sliders: ask the agent to produce a dialog window in Rhino with sensible defaults. One window, all parameters.
  • Specify units: if your Rhino doc uses millimetres, tell the agent.
  • Iterate incrementally: get a working basic version first, then layer complexity.
  • “Ask questions before writing”: for ambiguous prompts, instruct the agent to clarify before generating. Saves rewrites.

Next steps