/creative-media-tooling:rhino3d-scriptsfrom creative-media-tooling
Authors and debugs Rhino 3D scripts across RhinoScript, RhinoPython, RhinoCommon, C#, and command macros. Handles geometry, layers, blocks, documents, viewports, and Script Editor workflows.
Ships in creative-media-tooling. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create production-quality Rhino 8+ scripts and macros by choosing the right scripting surface, handling document tolerance, selection, redraw, undo, loading, and runtime differences between RhinoScript, RhinoPython, RhinoCommon, IronPython, and CPython.
_ScriptEditor supports Python 3, VB, and C#._EditPythonScript and _EditScript._-RunPythonScript; run RhinoScript with _-LoadScript plus _-RunScript.| Surface | Choose when | Extension |
|---|---|---|
RhinoPython (rhinoscriptsyntax plus RhinoCommon) | Default for new scripts; readable and full API access. | .py |
| RhinoScript (VBScript) | Maintaining legacy automation or COM/VBA integration. | .rvb, .vbs |
| RhinoCommon C#/.NET in Script Editor | Performance-critical loops, complex geometry, or .NET libraries. | .cs |
| Command macro | Pure command sequence with no variables, loops, or conditionals. | toolbar/alias |
A macro is not a script. Use a script as soon as the task needs a variable, loop, or conditional.
Python minimal scaffold:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def main():
obj_id = rs.GetObject("Select a curve", filter=rs.filter.curve, preselect=True)
if not obj_id:
return
length = rs.CurveLength(obj_id)
print("Length: {0:.4f}".format(length))
if __name__ == "__main__":
main()
RhinoCommon direct document code:
import Rhino
import scriptcontext as sc
doc = sc.doc
_tol = doc.ModelAbsoluteTolerance
circle = Rhino.Geometry.Circle(Rhino.Geometry.Point3d(0, 0, 0), 5.0)
curve_id = doc.Objects.AddCircle(circle)
doc.Views.Redraw()
VBScript scaffold:
Option Explicit
Call Main()
Sub Main()
Dim strObject
strObject = Rhino.GetObject("Select a curve", 4)
If IsNull(strObject) Then Exit Sub
Rhino.Print "Length: " & Rhino.CurveLength(strObject)
End Sub
Custom RhinoCommon picker:
go = Rhino.Input.Custom.GetObject()
go.SetCommandPrompt("Select breps")
go.GeometryFilter = Rhino.DocObjects.ObjectType.Brep
go.SubObjectSelect = False
go.GetMultiple(1, 0)
if go.CommandResult() != Rhino.Commands.Result.Success:
pass
else:
ids = [go.Object(i).ObjectId for i in range(go.ObjectCount)]
rs.EnableRedraw(False).undo = doc.BeginUndoRecord("My Op").rhinoscriptsyntax calls.doc.Views.Redraw() in try/finally.doc.EndUndoRecord(undo)..py or .rvb on disk.Options -> Files -> Search paths.! _-RunPythonScript "MyScript.py"! _-LoadScript "MyScript.rvb" _-RunScript MySubName! to cancel the running command and - for no-dialog script mode..rvb or .py in a search path.Tools -> Options -> RhinoScript or Python startup list.sc.doc is None because startup can run before a document opens.rhinoscriptsyntax returns GUIDs; RhinoCommon returns objects. Use doc.Objects.Find(guid) to bridge.(x, y, z) tuples or Rhino.Geometry.Point3d; VBScript uses Array(x, y, z).Option Explicit: otherwise typos create variables silently.Sub.Nothing, Empty, and Null differ: use IsNull, IsEmpty, or Is Nothing correctly.Call Foo(a, b) or Foo a, b, not Foo(a, b) for multi-argument subs.doc.ModelAbsoluteTolerance; do not hardcode 0.001.Rhino.RhinoApp.EscapeKeyPressed so users can cancel.System.Guid; check System.Guid.Empty by string when System is unavailable..rvb is .vbs renamed for Rhino LoadScript recognition.Rhino.RhinoApp.IsHeadless may be absent: use getattr(Rhino.RhinoApp, "IsHeadless", None).RhinoMath lives at Rhino.RhinoMath, not Rhino.DocObjects.RhinoMath.doc.Objects.AddBrep() returns 00000000-0000-0000-0000-000000000000 on failure.rhinoscriptsyntax has no type stubs: use # type: ignore on import rhinoscriptsyntax as rs if static analysis complains.random.py, math.py, or os.py; IronPython 2.7 resolves the script folder first.# -*- coding: utf-8 -*- and replace typographic em dash/arrow characters with ASCII equivalents for _-RunPythonScript.| Symptom | Resolution |
|---|---|
rs.GetObject returns None immediately | User pressed Escape or the rs.filter.* excludes all valid objects. |
| Unable to find script | Add the folder to Options -> Files -> Search paths. |
VBScript Type mismatch on coordinates | Pass a 3-element Array(x, y, z). |
ImportError: No module named Rhino | Run inside Rhino; external CPython needs rhino3dm only for read-only file work. |
| Geometry does not appear | Call doc.Views.Redraw() and re-enable rs.EnableRedraw(True). |
| Undo covers only the last object | Use BeginUndoRecord and EndUndoRecord. |
| Startup script fails | Guard document-dependent work when sc.doc is None. |
rs.Command("...") returns False | Prefix macro with ! and -, and end prompts with _Enter or a value. |
AttributeError: type object 'RhinoApp' has no attribute 'IsHeadless' | Guard with getattr(Rhino.RhinoApp, "IsHeadless", None). |
rhinocode script ignores arguments | Pass data via a project file or Rhino dialog; see references/macros-and-loading.md. |
Cannot import name <X> inside stdlib | Rename scripts that shadow stdlib modules or avoid imports that pull the shadowed name. |
SyntaxError: Non-ASCII character 'â' | Add # -*- coding: utf-8 -*- or replace non-ASCII characters. |
references/rhinoscriptsyntax-cheatsheet.md: most-used rs.* functions.references/rhinocommon-map.md: namespace map for RhinoCommon tasks.references/macros-and-loading.md: command-line macro syntax, LoadScript, RunScript, and search paths.references/vbscript-quirks.md: RhinoScript/VBScript traps.Preserve these legacy terms, API names, command placeholders, and literal phrases when applying or migrating this skill:
and guard againstas line 1, or replace the character: em dashcancels any running command; | IronPython 2.7 (| Property added in a later Rhino 8 build. Use! _-Line 0,0,0 10,0,0 _Enter%TEMP%) hit an em dash or similar character. Add , arrow , end every prompt with . The same file runs fine under AttributeErrorByValCallOptions → Files → Search pathsPylance/PyrightRhino.*Rhino.DisplayRhino.DocObjectsRhino.FileIORhino.GeometryRhino.GetObjectRhino.InputRhino.UIRhinoCommonRhinoDocRhinoObjectSyntaxError: Non-ASCII character '\xe2'System.Guid(str_id)TEMPTools → Options → RhinoScriptVBA/COM.Variant_LoadScript_RunScriptauto-convertedfilterimportimport randomimport tempfilemulti-argnon-obviousos.environper-documentrandomre-enabledsc.doc.Views.Count == 0scriptcontextsingle-argstandard-librarystr(obj_id) == "00000000-0000-0000-0000-000000000000"str_idtempfileActiveDocRhino.RhinoDoc.ActiveDocViews.Count## Rhino 3D scripting result
**Status:** script-created | macro-created | guidance-only | blocked
**Surface:** RhinoPython | RhinoScript | RhinoCommon C# | Command macro
### Artifact
- `<file or macro>`: <purpose>
### Runtime notes
| Concern | Decision |
| --- | --- |
| Tolerance | `doc.ModelAbsoluteTolerance` |
| Selection | <rs.GetObject/Rhino.Input.Custom.GetObject/etc.> |
| Undo/redraw | <BeginUndoRecord/EnableRedraw plan> |
| Loading | <RunPythonScript/LoadScript/ScriptEditor> |
### Validation
- <how to run in Rhino and expected geometry or document effect>
main() and guard execution with if __name__ == "__main__": when appropriate.Option Explicit.Rhino.RhinoApp.EscapeKeyPressed when relevant.!, -, _Enter, _RunPythonScript, _LoadScript, or _RunScript correctly.rhinocode are considered.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin creative-media-tooling11 skills in this plugin
/adobe-illustrator-scriptingWrite, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate documents, layers, paths, text frames, colors, symbols, artboards, or any Illustrator DOM objects. Covers the complete JavaScript object model, coordinate system, measurement units, export workflows, and scripting best practices./freecad-scriptsWrite FreeCAD Python scripts, macros, parametric FeaturePython objects, Part/Mesh/Sketcher geometry, PySide GUI tools, Coin3D/Pivy scenegraph code, workbench commands, and CAD automation. Use when asked to create FreeCAD models, automate geometry, convert mesh and solid data, script FEM/Path/TechDraw, or debug FreeCAD Python API tasks./game-engineBuild web-based game engines and games with HTML5 Canvas, WebGL, SVG, CSS, and JavaScript. Use when creating 2D or 3D games, implementing game loops, physics, collision detection, sprites, tilemaps, controls, audio, multiplayer with WebRTC or WebSockets, optimization, or publishing workflows.Other plugins' skills for the same job