Skip to content

Scripting API

Gemsets

Every setting in the Diamonds ribbon, headless. Each has its own page: what its facade can create, and what its handle can edit afterwards.

Conventions

Everything follows the house rules: millimetres, 0 keeps the tool default (or your saved defaults), profiles resolve by asset name, and mutations belong inside a Transaction.

Unless a page says otherwise, each setting is built around a mother gem and stays its parametric child.

Prong modes and claws

Every setting with prongs takes the same prongMode, at creation and on its handle (ProngMode / SetProngMode; prong_mode in Python and over MCP):

ValueProngs
ROUNDThe plain round prong, the default. DEFAULT and CIRCLE are read as ROUND
CUSTOMA profile section: pass a CLOSED_PROFILE asset (a profile alone asks for CUSTOM)
CLAWClaw tips
SettingModes
Basket, Martini, Halo (the mother gem’s prongs)ROUND, CUSTOM, CLAW
Advanced basketAlso OFFSET, DOUBLE and TRIPLE, on every prong. ProngMode reads MIXED when the panel’s per-prong editor left them different
Tulip, TrellisROUND, CLAW
TrilogiesCreateHalo and CreateEastWest like their settings; CreateIndividual and CreateTrellis ROUND or CLAW

Claw tips are built in Render mode only: in Production mode the prongs come out without them (the Outliner’s Rendering/Manufacturing selector, DocumentApi.SetComputationMode).

The claw of the martini, advanced basket, tulip and trellis shares four values, with the same meaning on all four:

ValueMeaning
ClawCapDistancemm the apex is pulled in toward the gem centre
ClawCapHeightmm the apex moves up (+) or down (-)
ClawTipWidthApex thickness as a fraction of the prong: 0 a sharp point, 1 the full tube
ClawTipSmoothnessBody-to-tip blend, 0 to 1

On the tulip the cap distance and height scale with the stone, and ClawTipLength sets how long the tip is. The trellis panel shows the four values as adjustments from 0; scripts read and write the claw actually built. The basket and the halo keep their classic claw under their own Claw* values: the basket in its Prong section (ClawGemInside, ClawHeight, ClawTension, ClawOnCurve), the halo on its handle (ClawGemInside, ClawTipDistance, ClawTipHeight, ClawTipWidth, ClawTension). A new halo set to CLAW starts from the tool’s claw values.

from ArtisanPlugin.Scripting import MartiniApi as martini, HaloApi as halo, GemApi as gem, Transaction

stones = gem.Selected()
with Transaction.Begin("Claw settings"):
    m = martini.Create(stones[0].Id, prongMode = "CLAW")
    h = halo.Create(stones[1].Id, prongMode = "CLAW")
    m.SetClawTipWidth(0.2)
    h.SetClawTension(70)

The three families

The settings split into three groups, and the difference decides what you pass in and what you get back.

FamilyPagesBuilt around
Single-gem settingsBezel, Advanced bezel, Peghead, Basket, Advanced basket, Halo, Hidden halo, Cluster, Tulip, Martini, TrellisAn existing mother gem — ForGem(gemId) finds them back
Standalone stone creatorsCabochon, PearlNothing — they create their own stone at a point
Many stones at onceGems on curve, Gems by network, Channel, Pave on surface, Micro settingA curve, a surface or a run of small gems

Cutters sit slightly apart: they are the drilling solids a seat is built from, one per gem, and you subtract them from the metal yourself.

What each one can do

Almost every setting can be built from scratch. What differs is how much of it you can still change afterwards: some handles regenerate the object through setters, others are read-only once created — run the tool in the UI to get a variant the script cannot reach.

SettingFacadeCreateEdit
BezelBezelApiyesfull
Advanced bezelAdvancedBezelApiyesread-only
PegheadPegheadApiyesfull
BasketBasketApiyes, one per gemprongs only
Advanced basketAdvancedBasketApiyes, one per gemprongs and rails
HaloHaloApiyesstone size and spacing
Hidden haloHiddenHaloApiyesstone size and spacing
ClusterClusterApiyesread-only
TulipTulipApiyespipe and height
MartiniMartiniApiyesprong height, side gems
TrellisTrellisGemsetApiyesread-only
CabochonCabochonApiyes, standalone stoneread-only
PearlPearlApiyes, standalone stoneread-only
CuttersCutterApiyes, one per gemread-only
Gems on curveGemsOnCurveApiyesread-only
Gems by networkGemsByNetworkApi-read-only
ChannelChannelApiyes, returns idsno handle
Pave on surfacePaveApiyes, returns gem idsno handle
Micro settingMicroSettingApiyes, returns idsread-only

Gems by network is the one setting with no Create: build the network in Rhino, then read, move and delete it from a script.

The shared surface

Every setting facade shares the same query surface — All(), Find(id), Count(), Selected(), ByLayer(name), plus ForGem(gemId) on single-gem settings and ForCurve(curveId) on curve-driven ones.

Handles share a structural base (Id, MotherGemId, ObjectType, LayerName, Position, Move, Delete); settings that wrap one gem also expose that gem’s GemShape, GemMaterial and GemCaratWeight.

On multi-gem objects (eternities, shanks, micro-settings) MotherGemId is empty by design; for curve-driven settings the parent is CurveId.

from ArtisanPlugin.Scripting import BezelApi as bezel

for b in bezel.All():
    print(b.Id, b.GemShape, b.GemCaratWeight)