Skip to content
Design
Skill

/scripting-reference

Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design

BOOST
From plugin
computational-design-skills
22318 skills
Install
$ npx -y skills add Abhinavbwj/Claude-skills-for-Computational-Designers --skill scripting-reference --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/scripting-reference

Context preview

The summary Claude sees to decide when to auto-load this skill.

Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design

SKILL.md

scripting-reference.SKILL.md
title: Scripting Reference
description: Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design
version: 1.0.0
tags: [scripting, Python, C-sharp, JavaScript, RhinoCommon, rhinoscriptsyntax, Three-js, pyRevit, code, programming]
auto_activate: true
user_invocable: true
invocation: /scripting-reference

Scripting Reference for AEC Computational Design

1. Scripting in AEC Computational Design

Why Code Beyond Visual Programming

Visual programming environments like Grasshopper, Dynamo, and Marionette have democratized computational design for architects and engineers. But they hit hard walls in practice:

  • **Complexity ceiling**: Definitions beyond ~200 nodes become unreadable spaghetti, impossible to maintain or hand off.
  • **Control flow limitations**: Try writing a recursive space-partitioning algorithm in pure Grasshopper. You cannot. Loops require plugins (Anemone, Hoopsnake) that add fragility.
  • **Performance**: Visual node evaluation carries overhead. A Python loop processing 50,000 mesh vertices runs 5-20x faster than equivalent wired-up components.
  • **Data management**: Parsing CSV, calling REST APIs, reading databases, writing Excel reports — all trivial in code, painful or impossible in visual programming.
  • **Version control**: A `.gh` file is a binary blob. A `.py` file is diffable, mergeable, reviewable text.
  • **Reusability**: Functions, classes, modules, packages — code is composable at every scale.
  • **Testing**: You can unit-test a Python function. You cannot unit-test a Grasshopper cluster.

The Scripting Spectrum

| Level | Tool | Difficulty | Use Case | |-------|------|------------|----------| | Entry | rhinoscriptsyntax (rs) | Easy | Quick automation, batch ops, simple geometry | | Intermediate | RhinoCommon (Python) | Medium | Complex geometry, intersections, analysis | | Intermediate | GhPython | Medium | Custom GH components, data tree manipulation | | Advanced | C# in GH | Hard | Performance-critical components, custom .gha | | Advanced | pyRevit / Dynamo Python | Medium | Revit automation, BIM scripting | | Advanced | Full .NET (C#/F#) | Hard | Production plugins, commercial tools | | Specialist | Three.js / WebGL | Medium | Web viewers, interactive presentations |

Choosing the Right Language

**Python** — Use when:

  • Rapid prototyping and iteration matter most
  • You need quick automation scripts (Rhino or Revit)
  • Working with data (CSV, JSON, API calls)
  • Algorithmic design exploration in Grasshopper
  • Team includes non-programmers who need to read the code

**C#** — Use when:

  • Performance is paramount (10-100x faster than Python for tight loops)
  • Building distributable Grasshopper plugins (.gha)
  • You need strong typing to catch errors at compile time
  • Integrating with .NET ecosystem libraries
  • Building production-grade Revit add-ins

**JavaScript/TypeScript** — Use when:

  • Building web-based viewers and dashboards
  • Client-facing model presentations
  • Collaborative design platforms
  • AR/VR experiences via WebXR
  • Integration with Speckle, IFC.js, or custom APIs

Python vs. C# for AEC — A Practical Comparison

Feature               Python                    C#
─────────────────────────────────────────────────────────────
Typing                Dynamic                   Static
Speed                 1x (baseline)             10-100x
REPL                  Yes (interactive)         No (compile required)
GH Component          GhPython node             Scripting / Visual Studio
Learning curve        Gentle                    Steeper
Error detection       Runtime                   Compile-time
Deployment            .py files                 .gha / .dll
External libraries    pip (huge ecosystem)      NuGet (large ecosystem)
Data science          Excellent (numpy, pandas) Good (MathNet, ML.NET)
String handling       Superior                  Adequate
Memory management     Automatic (GC)            Automatic (GC)
Multithreading        GIL limitation            Full parallel support

---

2. Python for Rhino (rhinoscriptsyntax)

The `rhinoscriptsyntax` module (imported as `rs`) wraps RhinoCommon in friendly, high-level functions. It is the fastest way to automate Rhino.

Module Overview

import rhinoscriptsyntax as rs

Object Creation Patterns

# Points
pt = rs.AddPoint(0, 0, 0)
pt2 = rs.AddPoint([10, 5, 3])

# Lines
line = rs.AddLine([0,0,0], [10,0,0])
line2 = rs.AddLine(rs.GetPoint("Start"), rs.GetPoint("End"))

# Polylines
pts = [[0,0,0],[5,0,0],[5,5,0],[0,5,0],[0,0,0]]
pline = rs.AddPolyline(pts)

# Curves
crv = rs.AddCurve(pts, degree=3)  # NURBS curve
interp = rs.AddInterpCurve(pts)    # interpolated through points

# Circles and Arcs
circle = rs.AddCircle([0,0,0], 5.0)
arc = rs.AddArc3Pt([0,0,0], [10,0,0], [5,5,0])
ellipse = rs.AddEllipse([0,0,0], 10, 5)

# Rectangles
rect = rs.AddRectangle([0,0,0], 10, 5)

# Surfaces
srf = rs.AddSrfPt([[0,0,0],[10,0,0],[10,10,0],[0,10,0]])
pipe = rs.AddPipe(crv, 0, 1.0)
loft = rs.AddLoftSrf([crv1, crv2])
extrusion = rs.ExtrudeCurveStraight(crv, [0,0,0], [0,0,5])
revolve = rs.AddRevSrf(profile_crv, axis_line)

# Meshes
mesh = rs.AddMesh([[0,0,0],[1,0,0],[1,1,0],[0,1,0]], [[0,1,2,3]])

# Solids
box = rs.AddBox([[0,0,0],[10,0,0],[10,10,0],[0,10,0],
                  [0,0,5],[10,0,5],[10,10,5],[0,10,5]])
sphere = rs.AddSphere([0,0,0], 5.0)
cylinder = rs.AddCylinder([0,0,0], [0,0,10], 3.0)
cone = rs.AddCone([0,0,0], [0,0,10], 5.0)

# Text and annotations
text = rs.AddText("Building A", [0,0,0], height=2.0)
dot = rs.AddTextDot("Label", [5,5,0])
leader = rs.AddLeader([[0,0,0],[5,5,0],[10,5,0]])
dim = rs.AddLinearDimension([0,0,0], [10,0,0], [5,2,0])

Object Query Patterns

# Selection
objs = rs.GetObjects("Select objects")
obj = rs.GetObject("Select one curve", r
Read more
Ships withcomputational-design-skills

Claude skills for Computational Designers

Get the whole plugin