rhino3d-scripts

Write and debug RhinoScript, RhinoPython, and RhinoCommon scripts for Rhinoceros 3D automation.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill rhino3d-scripts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rhino3d-scripts
Source: https://github.com/github/awesome-copilot/tree/main/skills/rhino3d-scripts
Command: npx skills add https://github.com/github/awesome-copilot --skill rhino3d-scripts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing scripts for Rhinoceros 3D involves three different scripting surfaces (VBScript, Python, C#/.NET), each with distinct syntax rules, runtime quirks, and failure modes that are poorly documented and easy to get wrong.

Core Features & Use Cases

  • Multi-surface scripting guidance: Covers RhinoScript (VBScript/.rvb), RhinoPython (rhinoscriptsyntax + scriptcontext), and direct RhinoCommon .NET access, with rules for choosing the right surface per task.
  • Geometry and document automation: Provides patterns for manipulating geometry, layers, blocks, viewports, object picking, redraw control, and undo records.
  • Deployment and troubleshooting: Explains command macros, search paths, startup scripts, toolbar buttons, the rhinocode CLI, and a detailed table of common errors like IronPython encoding failures and stdlib shadowing.
  • Use Case: A user asks to batch-rename hundreds of objects on a layer; the Skill produces a Python script using rs.EnableRedraw(False), a single undo record, and direct RhinoCommon calls for performance.

Quick Start

Ask the assistant to write a RhinoPython script that selects all curves on a given layer and prints their total length.

Frequently Asked Questions about rhino3d-scripts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Python script for Rhino 3D?

Use RhinoPython with `import rhinoscriptsyntax as rs` and `import scriptcontext as sc` inside Rhino's Script Editor. Run saved .py files with `_-RunPythonScript "MyScript.py"` or open the Rhino 8 unified editor with `_ScriptEditor`.

Should I use RhinoScript, RhinoPython, or RhinoCommon for Rhino automation?

Choose RhinoPython for new scripts since it is readable and has full RhinoCommon access. Use RhinoScript (VBScript) only for maintaining legacy .rvb files, and C# via the Script Editor for performance-critical loops or complex geometry work.

Why does my Rhino Python script fail with a non-ASCII character error?

IronPython 2.7, used by `_-RunPythonScript`, raises a SyntaxError on em dashes and other non-ASCII characters. Add `# -*- coding: utf-8 -*-` as line 1 or replace typographic characters with ASCII equivalents; CPython 3 via rhinocode is unaffected.

Why does my Rhino script work alone but fail as a startup script?

Startup scripts run before any document is open, so `sc.doc` is None. Guard document-dependent code with an early return when `sc.doc is None` to avoid failures at Rhino launch.

How do I pass arguments to a script run through the rhinocode CLI?

rhinocode does not support positional arguments after the script path; extra tokens get concatenated onto the file URI. Pass data through a temp file at a known location or prompt the user with a Rhino dialog like `rs.GetString`.

Why does undo only revert the last object after my batch script?

Each document mutation creates its own undo record by default. Wrap the batch in `doc.BeginUndoRecord("Batch Op")` and `doc.EndUndoRecord(serial)` so the entire operation reverts as a single undo step.