execute_rhino_script
Compile and execute C# RhinoCommon scripts in Rhino 8 to create geometry, returning created object GUIDs or error details.
Instructions
Sends a C# RhinoCommon script to the Rhino 3D Bridge for compilation and execution. The script is compiled by Roslyn inside Rhino and executed natively as JIT-compiled C#.
The script MUST define a class with a static Run method that returns created GUIDs:
public class Script
{
public static List<Guid> Run(RhinoDoc doc)
{
var guids = new List<Guid>();
// Use doc.Objects.AddSphere(), doc.Objects.AddBrep(), etc.
// Append each GUID: guids.Add(guid);
return guids;
}
}Available namespaces (auto-imported if not present): System, System.Collections.Generic, System.Linq, Rhino, Rhino.Geometry, Rhino.DocObjects
Args: script: C# source code containing a class with public static List Run(RhinoDoc doc). Returns: JSON with status (success/compile_error/runtime_error), created GUIDs, or error trace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |