Skip to content

.NET API

BezelApi

Bezel settings with support, cutter and air-gap sections.

from ArtisanPlugin.Scripting import BezelApi

See also the guide, Gemsets › Bezel, and the Python package, ra.bezel.

Methods

Method
AllIBezel handles for every object of this kind in the active document (empty when there is no document).
ByLayerIBezel handles on the layer with the given full path (empty when the layer does not exist).
CountNumber of objects of this kind in the active document.
CreateBuilds a bezel around an existing gem (gemId must be a gem in the active document — the bezel is a parametric child of that gem).
FindThe handle for id, or null when the id does not belong to an object of this kind.
ForGemIBezel handles whose mother gem is gemId (empty for Guid.Empty).
SelectedBezels currently selected in the active doc.

All

IReadOnlyList<IBezel> BezelApi.All()

IBezel handles for every object of this kind in the active document (empty when there is no document).

Returns IReadOnlyList<IBezel>.

ByLayer

IReadOnlyList<IBezel> BezelApi.ByLayer(string layerName)

IBezel handles on the layer with the given full path (empty when the layer does not exist).

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<IBezel>.

Count

int BezelApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

IBezel BezelApi.Create(
    Guid gemId,
    double height = 0,
    double width = 0,
    double girdleHeight = 0,
    double girdleWidth = 0,
    double gemInside = 0,
    string profile = null,
    int supportCount = 0,
    double supportWidth = 0,
    double supportThickness = 0,
    int cutterCount = 0,
    double cutterWidth = 0,
    double cutterHeight = 0,
    string cutterProfile = null,
    int airgapCount = 0,
    double airgapWidth = 0,
    double airgapHeight = 0,
    string airgapProfile = null,
    string element = null)

Builds a bezel around an existing gem (gemId must be a gem in the active document — the bezel is a parametric child of that gem). Uses the same default profile assets and compute pipeline as the ArtisanBezel tool, so the result is identical to inserting one from the panel. All dimensional arguments are millimetres. Pass 0 (or omit) to keep the default for that parameter: the user’s saved Bezel defaults when there are any (the panel’s save-as-default), otherwise the tool’s (height 3.8, width 1.5, girdle height 0.3, girdle width 1.5, gem inside 0). profile picks a BEZEL_PROFILE asset from the library by name (see AssetsApi.List(“BEZEL_PROFILE”)); omitted = the default profile. The support posts and the two piercing blocks (cutters and air gaps, both OFF by default) are opened here by their count: passing cutterCount/airgapCount > 0 enables that block. Their signed parameters — displacement and the three rotations — are not arguments here, because 0 is a meaningful value for them and this signature reads 0 as “keep the default”; set those through the returned handle (bezel.Cutters.SetVerticalRotation(...)), which takes literal values. Throws if gemId is not a gem, if the bezel geometry fails to compute, or if the license is invalid.

ParameterTypeDefault
gemIdGuidrequired
heightdouble0
widthdouble0
girdleHeightdouble0
girdleWidthdouble0
gemInsidedouble0
profilestringnull
supportCountint0
supportWidthdouble0
supportThicknessdouble0
cutterCountint0
cutterWidthdouble0
cutterHeightdouble0
cutterProfilestringnull
airgapCountint0
airgapWidthdouble0
airgapHeightdouble0
airgapProfilestringnull
elementstringnull

Returns IBezel.

Find

IBezel BezelApi.Find(Guid id)

The handle for id, or null when the id does not belong to an object of this kind.

ParameterTypeDefault
idGuidrequired

Returns IBezel.

ForGem

IReadOnlyList<IBezel> BezelApi.ForGem(Guid gemId)

IBezel handles whose mother gem is gemId (empty for Guid.Empty).

ParameterTypeDefault
gemIdGuidrequired

Returns IReadOnlyList<IBezel>.

Selected

IReadOnlyList<IBezel> BezelApi.Selected()

Bezels currently selected in the active doc. Empty list if nothing is selected or the selection contains no bezels.

Returns IReadOnlyList<IBezel>.

Handles and sections

What the methods above hand back. A handle’s setters regenerate the object; wrap changes in a Transaction so they land as one undo step.

IBezel

Handle — extends IGemSetting, IParametricObject.

PropertyType
AirGapsIBezelPiercingget
CuttersIBezelPiercingget
GemCaratWeightdoubleget(from IGemSetting)
GemInsidedoubleget
GemMaterialstringget(from IGemSetting)
GemShapestringget(from IGemSetting)
GirdleHeightdoubleget
GirdleWidthdoubleget
HeightdoublegetCurrent values of the bezel wall (millimetres).
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
PositionPoint3dget(from IParametricObject)
ProfileNamestringgetBEZEL_PROFILE asset name, "" when unset
SupportIBezelSupportgetThe rest of the tool’s parameters, grouped as the panel groups them.
Widthdoubleget
Method
void Delete()(from IParametricObject)
void Move(Vector3d translation)(from IParametricObject)
void SetElement(string element)Applies a saved Bezel element (ElementsApi.List(“Bezel”)) to this bezel: its parameters replace the current ones, the mother gem stays, and the bezel regenerates in place (same Guid).
void SetGemInside(double gemInside)
void SetGirdleHeight(double girdleHeight)
void SetGirdleWidth(double girdleWidth)
void SetHeight(double height)Parametric edits — each regenerates the bezel in place (same Guid) and calls LicenseGate.RequireValid() first. Millimetres.
void SetProfile(string assetName)BEZEL_PROFILE asset name
void SetWidth(double width)

IBezelSupport

Section.

The posts that hold the bezel over the shank.

PropertyType
Countintgetnumber of support posts, 0 = none (max 6)
Thicknessdoublegetmm
Widthdoublegetmm
Method
void SetCount(int count)0-6; 0 removes the supports
void SetThickness(double thickness)mm, > 0
void SetWidth(double width)mm, > 0

IBezelPiercing

Section.

The repeated solids pierced around the bezel wall. The same shape drives two independent sections: the CUTTERS (subtracted, the classic scalloped windows) and the AIR GAPS (the openings under the girdle).

PropertyType
Countintgethow many are distributed around the bezel
Displacementdoublegetmm along the bezel axis, SIGNED
Enabledboolget
GlobalRotationdoublegetdegrees, the whole ring of piercings, SIGNED
Heightdoublegetmm
ProfileNamestringgetCLOSED_PROFILE asset name, "" when unset
Rotationdoublegetdegrees, each piercing around its own axis, SIGNED
VerticalRotationdoublegetdegrees, tilt of each piercing, SIGNED
Widthdoublegetmm
Method
void SetCount(int count)> 0; also enables the section
void SetDisplacement(double displacement)mm, signed
void SetEnabled(bool enabled)
void SetGlobalRotation(double degrees)signed
void SetHeight(double height)mm, > 0
void SetProfile(string assetName)CLOSED_PROFILE asset name
void SetRotation(double degrees)signed
void SetVerticalRotation(double degrees)signed
void SetWidth(double width)mm, > 0