Scripting API
RhinoArtisan Scripting API
Everything you can do in RhinoArtisan by hand, you can do in code. The Scripting API turns the full jewelry toolset — gems, settings, shanks, weights, pricing, manufacturing exports — into a clean set of Python facades (GemApi, BezelApi, PricingApi, …) that run entire workflows with no dialogs and no mouse.
from Rhino.Geometry import Plane
from ArtisanPlugin.Scripting import GemApi as gem, Transaction
with Transaction.Begin("Add a one-carat round diamond"):
gem.Create("ROUND", "Diamond", 1.0, Plane.WorldXY)
Five lines, one undo step, and a gem identical to one placed through the UI.
What you can build with it
- Size runs and variants. Generate a ring in every size, a pendant in three metals, a collection in one pass — instead of one file at a time.
- Parametric designs. Drive stone counts, spacings and dimensions from data: a CSV of orders, a formula, a customer configurator.
- Pricing and quoting. Pull metal weights and stone lists straight from the model and feed them into your own quoting or ERP flow.
- Manufacturing pipelines. Validate, name, export and report on production files automatically, the same way every time.
If your studio does it more than once, it is worth a script.
Design principles
The API follows the same rules everywhere, so what you learn on one facade applies to all of them:
- A stable, jewelry-aware contract. Scripts work with clear interfaces like
IGemandIBezelthat stay compatible as RhinoArtisan evolves. - Friendly errors. Pass a bad argument — an unknown gem shape, a negative carat weight — and you get a clear, human-readable message, not a stack trace.
- Undo in one step. Mutations are grouped in a
Transaction, so an entire scripted operation reverts with a single Ctrl+Z. - Indistinguishable results. A gem placed by script is identical to a gem placed by hand — same geometry, same data, same downstream tools.
Licensing
The Scripting API is part of your RhinoArtisan license — no extra module to buy. It requires a valid license just like the UI tools: every call that creates, modifies or deletes something in the document verifies it first and raises a clear, actionable error if it isn’t valid. You don’t manage any of this from your script; it’s built into every facade.
Your seat covers scripts you run and supervise yourself. Unattended pipelines (scheduled or server-side jobs) and systems that serve third parties have their own licenses — see the EULA and talk to us about Automation and OEM agreements. What counts is how the script runs, not where: Windows Server, Rhino.Compute or a workstation acting as a server are all the same case.
What’s new in 7.0.0.10
- Elements: build from a saved preset with
element=, apply one withSetElement, save an object as a new preset, and manage the library (rename, duplicate, favorites, delete, export and import bundles). - Assets: reference a profile by
"id:<n>", preview it withExportAsCurve, and rename, duplicate, set the default or delete. - Smart profile:
SmartProfileApiand theISmartProfilehandle, which edits section by section. - Editing smart components:
SmartComponentApifinds bails, bangles, charms… and edits them after creation. - Cutters:
fitToGemfor fancy cuts, andICuttersetters. - Bail: wire profiles, side curves and O-ring options, placed on the metal layer.
- Basket rails:
DEFAULT/CUSTOMmodes. - Command panels:
PanelsApi.Active()andClose().
Where to go next
- Getting Started — your first script, step by step.
- Core Concepts — transactions, handles, error handling, units.
- Handles — every handle interface, one page each.
- API Reference — every facade, every method.
- Python package — Rhino 8+:
import rhinoartisan as ra, the same API as plain Python 3 (generated reference, one page per module).
What the API deliberately does not do
- It does not expose raw meshes or breps — use
rhinoscriptsyntax/RhinoCommonfor freeform geometry. - Not every parametric field is editable yet. Most shank and gemset handles have setters, and smart components are edited by path, but some handles are still read-only for part of their model. Coverage grows release by release, and the API Reference shows what each facade can create, edit and query.