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.
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.
What the API deliberately does not do
- It does not expose raw meshes or breps — use
rhinoscriptsyntax/RhinoCommonfor freeform geometry. - Parametric editing of complex objects (changing a halo’s stone count after creation) is limited: most parametric fields on handles are read-only today. Creation coverage grows release by release — see the API Reference for what each facade can create versus query.