Scripting API
Bezel
from ArtisanPlugin.Scripting import BezelApi as bezel
A bezel is the continuous metal collar that surrounds a stone and holds it by folding a rim over its girdle - the oldest and most protective way to set a gem. The tool sweeps a BEZEL_PROFILE section around the stone’s outline and lands the wall against the girdle, exactly as the ArtisanBezel panel does.
Every bezel is built around a mother gem and stays its parametric child: gemId must already be a gem in the active document, and the bezel keeps that link for the rest of its life.
Create
b = bezel.Create(gemId, height = 3.8, width = 1.5,
girdleHeight = 0.3, girdleWidth = 1.5,
gemInside = 0, profile = None) # -> IBezel
| Parameter | Default | Meaning |
|---|---|---|
gemId | - | The mother gem it wraps - throws if the object is not a gem |
height | 3.8 | Wall height, mm |
width | 1.5 | Wall width (metal thickness), mm |
girdleHeight | 0.3 | Height of the girdle step, mm |
girdleWidth | 1.5 | Width of the girdle step, mm |
gemInside | 0 | How deep the stone sits inside the collar, mm |
profile | None | BEZEL_PROFILE asset by name - see AssetsApi.List("BEZEL_PROFILE") |
All dimensions are millimetres, and 0 keeps the tool default for that parameter, so you only pass what you actually want to change. The two closing profiles come from the default CLOSED_PROFILE asset, as in the panel.
Create throws if gemId is not a gem, if the geometry fails to compute, or if the licence is invalid.
Edit
Create, Find and All return an IBezel handle. Each setter regenerates the object in place, keeping its Guid and undo intact:
| Setter | What it changes |
|---|---|
SetHeight(mm) | Wall height - must be > 0 |
SetWidth(mm) | Wall width - must be > 0 |
SetGirdleHeight(mm) | Height of the girdle step - must be > 0 |
SetGirdleWidth(mm) | Width of the girdle step - must be > 0 |
SetGemInside(mm) | Seat depth of the stone; accepts any value, including negatives |
The handle also reports GemShape, GemMaterial and GemCaratWeight for the mother stone, plus the shared Id, MotherGemId, LayerName, Position, Move() and Delete().
from ArtisanPlugin.Scripting import BezelApi as bezel, Transaction
b = bezel.Selected()[0]
with Transaction.Begin("Taller bezel"):
b.SetHeight(4.2)
b.SetWidth(1.2)
Mutations belong inside a Transaction so the whole edit lands as one undo step.
Queries
All(), Find(id), Count(), Selected(), ByLayer(name), ForGem(gemId).