Skip to content

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, girdleHeight = 0.3, girdleWidth = 1.5,
                 gemInside = 0, bottomWidth = 1, wallAngle = 8,
                 seatWidth = 0.3, profile = None)               # -> IBezel
ParameterDefaultMeaning
gemId-The mother gem it wraps - throws if the object is not a gem
height3.8Wall height, mm
girdleHeight0.3Height of the girdle step, mm
girdleWidth1.5Width of the girdle step, mm
gemInside0How deep the stone sits inside the collar, mm
bottomWidth1Width of the flat base of the wall, mm; the base measures exactly this
wallAngle8Angle of the inner wall from the vertical, degrees, below the seat: positive brings the base in toward the stone (a cup), negative opens it, 0 is straight. -60 to 60
seatWidth0.3Width of the gem seat, mm: the bevel under the girdle that follows the stone’s pavilion. 0 = no seat
profileNoneBEZEL_PROFILE asset by name - see AssetsApi.List("BEZEL_PROFILE")
width-Legacy: still accepted so existing scripts keep running, but it no longer shapes the bezel. Use wallAngle and bottomWidth

All dimensions are millimetres, and 0 keeps the tool default for that parameter (except wallAngle and seatWidth, where 0 is a real value: leave them out to keep the default), 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:

SetterWhat it changes
SetHeight(mm)Wall height - must be > 0
SetBottomWidth(mm)Width of the flat base of the wall
SetWallAngle(degrees)Inner wall angle below the seat; 0 = straight
SetSeatWidth(mm)Width of the pavilion seat; 0 = no seat
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.SetWallAngle(12)
    b.SetSeatWidth(0.25)

SetWidth and Width remain for old scripts but no longer change the geometry. Through MCP, add_bezel_setting takes bottom_width, wall_angle and seat_width.

Mutations belong inside a Transaction so the whole edit lands as one undo step.

Queries

All(), Find(id), Count(), Selected(), ByLayer(name), ForGem(gemId).