.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 | |
|---|---|
All | IBezel handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | IBezel handles on the layer with the given full path (empty when the layer does not exist). |
Count | Number of objects of this kind in the active document. |
Create | 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). |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
ForGem | IBezel handles whose mother gem is gemId (empty for Guid.Empty). |
Selected | Bezels 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).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
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.
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
height | double | 0 |
width | double | 0 |
girdleHeight | double | 0 |
girdleWidth | double | 0 |
gemInside | double | 0 |
profile | string | null |
supportCount | int | 0 |
supportWidth | double | 0 |
supportThickness | double | 0 |
cutterCount | int | 0 |
cutterWidth | double | 0 |
cutterHeight | double | 0 |
cutterProfile | string | null |
airgapCount | int | 0 |
airgapWidth | double | 0 |
airgapHeight | double | 0 |
airgapProfile | string | null |
element | string | null |
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.
| Parameter | Type | Default |
|---|---|---|
id | Guid | required |
Returns IBezel.
ForGem
IReadOnlyList<IBezel> BezelApi.ForGem(Guid gemId)
IBezel handles whose mother gem is gemId (empty for Guid.Empty).
| Parameter | Type | Default |
|---|---|---|
gemId | Guid | required |
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.
| Property | Type | ||
|---|---|---|---|
AirGaps | IBezelPiercing | get | |
Cutters | IBezelPiercing | get | |
GemCaratWeight | double | get | (from IGemSetting) |
GemInside | double | get | |
GemMaterial | string | get | (from IGemSetting) |
GemShape | string | get | (from IGemSetting) |
GirdleHeight | double | get | |
GirdleWidth | double | get | |
Height | double | get | Current values of the bezel wall (millimetres). |
Id | Guid | get | (from IParametricObject) |
LayerName | string | get | (from IParametricObject) |
MotherGemId | Guid | get | (from IParametricObject) |
ObjectType | string | get | (from IParametricObject) |
Position | Point3d | get | (from IParametricObject) |
ProfileName | string | get | BEZEL_PROFILE asset name, "" when unset |
Support | IBezelSupport | get | The rest of the tool’s parameters, grouped as the panel groups them. |
Width | double | get |
| 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.
| Property | Type | ||
|---|---|---|---|
Count | int | get | number of support posts, 0 = none (max 6) |
Thickness | double | get | mm |
Width | double | get | mm |
| 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).
| Property | Type | ||
|---|---|---|---|
Count | int | get | how many are distributed around the bezel |
Displacement | double | get | mm along the bezel axis, SIGNED |
Enabled | bool | get | |
GlobalRotation | double | get | degrees, the whole ring of piercings, SIGNED |
Height | double | get | mm |
ProfileName | string | get | CLOSED_PROFILE asset name, "" when unset |
Rotation | double | get | degrees, each piercing around its own axis, SIGNED |
VerticalRotation | double | get | degrees, tilt of each piercing, SIGNED |
Width | double | get | mm |
| 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 |