Scripting API
Advanced bezel
from ArtisanPlugin.Scripting import AdvancedBezelApi as advbezel
The advanced bezel is the same collar of metal around a stone, but its wall cross-section is a freely editable point profile rather than a swept profile asset - so the outside can be flared, stepped or tapered instead of following a fixed section. Cutters and airgaps are configured as the tool’s defaults set them.
It is built around a mother gem and stays its parametric child: gemId must already be a gem in the active document.
Create
b = advbezel.Create(gemId, height = 3.8, width = 1.5,
girdleHeight = 0.3, girdleWidth = 1.5,
gemInside = 0, profile = None) # -> IAdvancedBezel
| 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") |
Millimetres throughout, and 0 keeps the tool default - or the user’s saved defaults for the advanced bezel, when they have stored any. Passing an explicit profile deliberately skips those saved defaults, since saved defaults replace the whole model and would otherwise overwrite the profile you asked for. Without a saved profile the wall uses the 6-point default section.
Create throws ArgumentException if gemId is not a gem, and InvalidOperationException when the kernel cannot build the geometry with the given parameters (it reports keys such as INVALID_HEIGHT or INVALID_GIRDLE_WIDTH).
Edit
Read-only after creation. The parametric engine has no regenerate step for advanced bezels, so IAdvancedBezel exposes no setters - to change one, Delete() it and Create a new one.
What the handle reads back:
| Member | Meaning |
|---|---|
Height, Width | Wall height and width, mm |
GirdleHeight, GirdleWidth | The girdle step, mm |
GemInside | Seat depth of the stone, mm |
GemShape, GemMaterial, GemCaratWeight | The mother stone |
Id, MotherGemId, LayerName, Position | Shared parametric-object properties |
Move(vector), Delete() | The only mutations - wrap them in a Transaction |
from ArtisanPlugin.Scripting import AdvancedBezelApi as advbezel, Transaction
old = advbezel.Selected()[0]
gemId = old.MotherGemId
with Transaction.Begin("Rebuild advanced bezel"):
old.Delete()
advbezel.Create(gemId, height = 4.2)
Queries
All(), Find(id), Count(), Selected(), ByLayer(name), ForGem(gemId).