> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runchat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rhino Tools

> Make your own Rhino toolbar buttons with Runchat. Turn a Python or C# script, or a small HTML app, into a tool you can publish, share with your team, and install in one click.

A **CAD tool** is a button on your Runchat toolbar in Rhino. Ask the [agent](https://docs.runchat.com/concepts/agents/chat.md) to build one, publish it, and anyone you share it with can install it from its page. No compiling, no `.rhp` files, no Yak packages.

![A Rhino app tool docked beside the viewport, showing the model's units and object count and a capture of the viewport](https://mintcdn.com/runchat/s-X6A0-09tcVxLu0/images/rhino-tools/inspector.webp?fit=max\&auto=format\&n=s-X6A0-09tcVxLu0\&q=85\&s=70962fb2173d798f0dfc264262b9209b)

CAD tools come in two kinds:

| Kind | What clicking it does | Use it when |
| - | - | - |
| **Script** | Runs a Python or C# script in your active document | One click is enough: work on the current selection and finish |
| **App** | Opens an HTML app in a dockable Rhino panel | The tool needs inputs, a preview, or an AI model |

> [!NOTE]
>
> CAD tools need Rhino 8 or later and Runchat for Rhino 0.3.79 or later. See [Runchat for Rhino](https://docs.runchat.com/plugins/rhino.md) to install the plugin.

## Create a tool

Describe the tool to the agent, in the Runchat panel in Rhino or in any editor. For example:

> Make a Rhino tool that offsets the selected surfaces by 200 mm and puts the results on a new layer called Offsets.

> Make a Rhino app tool that captures my viewport, renders it as a watercolour sketch, and lets me import the result back into Rhino.

The agent writes the tool as a **CAD Tool** [artifact](https://docs.runchat.com/concepts/dashboard/artifacts.md) and installs it for you. With the Runchat panel open in Rhino, the button appears on your **Runchat** toolbar within a few seconds, and updates each time the agent changes the tool. If the button doesn't do what you expected, keep chatting and the agent updates the same tool.

**1. Describe the tool**

Say what it should work on (the selection, a layer, the whole model) and what it should produce. The agent asks if anything is unclear.

**2. Try it in Rhino**

Click the new button on the Runchat toolbar, or type its alias (for example `RC_OffsetFacade`) on the command line.

**3. Iterate**

Paste screenshots or command line errors back into the chat. Each change is picked up the next time the Runchat panel connects.

**4. Publish and share**

Publish the tool so teammates or the public can install it from its page.

## Use a tool in Rhino

Installed tools appear as buttons on the **Runchat** toolbar, which you can dock like any other Rhino toolbar.

* **Click** a button to run the tool.
* **Type the alias** on the command line to run it without the toolbar, or use it in your own macros.
* **Right-click** a button to open the tool's docs.

### App panels

An app tool opens in a Rhino panel named **Runchat App 1** to **Runchat App 4**. The panel tab shows the tool's icon. Drag the tab to dock it next to **Layers** or **Properties**, float it, or open two apps side by side. Close a panel with Rhino's own tab close button; the next app you open reuses the slot.

![An app tool docked in a Runchat App panel next to the Rhino viewport, showing the model's units, object count and active view](https://mintcdn.com/runchat/s-X6A0-09tcVxLu0/images/rhino-tools/app-panel.webp?fit=max\&auto=format\&n=s-X6A0-09tcVxLu0\&q=85\&s=a6ac22e6631f06ccf311dc3857d54c3a)

Docked app panels come back with their app when you restart Rhino.

App panels share the Runchat panel's sign-in, so apps can run your published workflows and use your credits without signing in again.

## Find and install tools

Every tool has a public page with its icon, description, docs and an **Install** button. Click **Install** and the tool appears on your toolbar the next time the Runchat panel is open in Rhino. Click **Installed — remove** on the same page to take it off.

To find your own and your team's CAD tools, open the [Artifacts dashboard](https://runchat.com/dashboard/artifacts) and set **Type** to **CAD Tool**.

## Publish and share

A CAD tool is an artifact, so it is published the same way:

* **Draft** tools work only for you. You don't need to publish a script tool to use it yourself.
* **App** tools must be published before they open in Rhino, because the panel loads the tool's page.
* Set **Visibility** from the tool's **…** menu on the Artifacts dashboard: **Team** shares it with your teammates, **Public** lists it in the gallery.

Anyone who installs a tool runs it in their own Rhino with their own account: an app tool's model runs are billed to the person using it.

## How a tool is built

You don't need to write any of this yourself, but it helps to know what the agent produces when you want to edit a tool by hand. A CAD tool artifact is a folder of files with a `tool.json` manifest:

```json tool.json (script) theme={null}
{
  "name": "Offset Facade",
  "alias": "RC_OffsetFacade",
  "tooltip": "Offsets the selected surfaces by 200 mm",
  "icon": "icon.svg",
  "docs": "README.md",
  "action": { "kind": "script", "language": "python", "entry": "main.py" }
}
```

```json tool.json (app) theme={null}
{
  "name": "Sketch Render",
  "alias": "RC_SketchRender",
  "tooltip": "Render the viewport as a sketch and import it",
  "icon": "icon.svg",
  "docs": "README.md",
  "action": { "kind": "app", "entry": "index.html" }
}
```

| Field | Meaning |
| - | - |
| `name` | Shown on the tool page and as the button's label |
| `alias` | The command name you can type in Rhino. Letters, digits and `_`, starting with a letter |
| `tooltip` | Shown when you hover the button |
| `icon` | An SVG file, drawn at toolbar size in light and dark themes. Simple shapes with solid fills work best |
| `docs` | A Markdown file shown on the tool page and opened when you right-click the button |
| `action` | `script` with a `language` (`python` or `csharp`) and an `entry` file, or `app` with an HTML `entry` file |

### Script tools

A script tool runs with no inputs, so it works from what's selected and reports back on the command line:

```python main.py theme={null}
import rhinoscriptsyntax as rs
import Rhino

ids = rs.SelectedObjects()
if not ids:
    Rhino.RhinoApp.WriteLine("Select some surfaces first, then run Offset Facade.")
else:
    layer = rs.AddLayer("Offsets")
    for id in ids:
        offset = rs.OffsetSurface(id, 200)
        if offset:
            rs.ObjectLayer(offset, layer)
```

Scripts run inside Rhino's own Python 3 and C# environment, so they can use anything RhinoCommon offers, and each run is a single undo step.

### App tools

An app tool is a Runchat [app artifact](https://docs.runchat.com/concepts/publishing/app-view.md) with one extra: `runchat.rhino` reaches the Rhino of whoever is using it.

| Method | Returns |
| - | - |
| `runchat.rhino.context()` | Units, object counts, the selection and the active view |
| `runchat.rhino.capture({ view, display_mode, width, height })` | `{ url, metadata }`: an uploaded viewport image |
| `runchat.rhino.exportSelection({ scope })` | `{ url, objects, bounds, units }`: a GLB of the `"selection"`, a `"layer"` or `"all"` |
| `runchat.rhino.runScript(code, { language })` | `{ success, message, output }`. Set `runchat_result` in the script to return data |
| `runchat.rhino.importModel(url)` | Imports a `.glb` (as meshes) or `.svg` (as curves) into the document, on the current layer |

A typical app captures or exports from Rhino, runs a published workflow with [`runchat.run`](https://docs.runchat.com/concepts/publishing/app-view), and imports the result:

```js index.html theme={null}
const shot = await runchat.rhino.capture({ display_mode: "Shaded", width: 1024 });
const result = await runchat.run("YOUR_WORKFLOW_ID", { image: shot.url });
await runchat.rhino.importModel(result.model);
```

> [!NOTE]
>
> `runchat.rhino` only works for signed-in people who have installed the tool and have Rhino open with the Runchat panel connected. Anywhere else, its calls fail with a message saying why.

## Troubleshooting

> [accordion] My tool doesn't appear on the toolbar
>
> Tools sync while the Runchat panel is open in Rhino, so open it (type `Runchat`) and check that you are signed in to the account that installed the tool. If the toolbar itself is hidden, type `RunchatToolbar` to show it.

> [accordion] An app tool says it has no app page yet
>
> App tools open their published page. Publish the tool and the toolbar picks up the page within a few seconds.

> [accordion] A script tool fails
>
> Errors and the traceback are printed on the Rhino command line. Copy them into the chat and the agent will fix the script.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.