.NET API
CabochonApi
Cabochon stones and their settings.
from ArtisanPlugin.Scripting import CabochonApi
See also the guide, Gemsets › Cabochon, and the Python package, ra.cabochon.
Methods
| Method | |
|---|---|
All | ICabochon handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | ICabochon 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 | Creates a cabochon stone (the ArtisanCabochon tool, headless) and adds it to the active document. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
Selected | Cabochons currently selected in the active doc. |
All
IReadOnlyList<ICabochon> CabochonApi.All()
ICabochon handles for every object of this kind in the active document (empty when there is no document).
Returns IReadOnlyList<ICabochon>.
ByLayer
IReadOnlyList<ICabochon> CabochonApi.ByLayer(string layerName)
ICabochon handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<ICabochon>.
Count
int CabochonApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
ICabochon CabochonApi.Create(
double x = 0,
double y = 0,
double z = 0,
string shape = null,
string type = null,
double? angle = null,
double? girdleHeight = null,
Plane? plane = null,
double? girdleAngle = null)
Creates a cabochon stone (the ArtisanCabochon tool, headless) and adds it to the active document. Unlike Bezel/AdvancedBezel, a cabochon does NOT wrap a mother gem: it is its own stone, placed on plane (omitted = world XY, like the panel’s “add on plane”). All dimensional arguments are millimetres. Pass 0 (or omit) to keep the tool’s default — or the user’s saved defaults — for that parameter (x 4, y 8, z 2, angle 15 degrees, girdleHeight 1). shape accepts case-insensitive CabochonShape names (“Round”, “Oval”, “Rectangular”, “Heart”, “Pear”, “Marquise”, “Diamond”); type accepts CabochonType names (“Cabochon”, “FlatTopSingleBevel”, “FlatTopDoubleBevel”, “BuffTopSingleBevel”, “BuffTopDoubleBevel”). Omitted/null keeps the default (Round / Cabochon or the saved defaults). Throws ArgumentException for an unknown shape/type name and InvalidOperationException when the geometry fails to compute.
| Parameter | Type | Default |
|---|---|---|
x | double | 0 |
y | double | 0 |
z | double | 0 |
shape | string | null |
type | string | null |
angle | double? | null |
girdleHeight | double? | null |
plane | Plane? | null |
girdleAngle | double? | null |
Returns ICabochon.
Find
ICabochon CabochonApi.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 ICabochon.
Selected
IReadOnlyList<ICabochon> CabochonApi.Selected()
Cabochons currently selected in the active doc. Empty list if nothing is selected or the selection contains no cabochons.
Returns IReadOnlyList<ICabochon>.
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.
ICabochon
Handle — extends IParametricObject.
A cabochon is its own stone (round / oval / rectangular / … dome cut): it is not built around a mother gem, so it extends IParametricObject directly and MotherGemId is always Guid.Empty. The setters recompute the stone and replace it in place, keeping its Guid (the same thing the panel does on accept), and take LITERAL values: a 0 angle is a straight wall and a 0 girdle height is no girdle.
| Property | Type | ||
|---|---|---|---|
Angle | double | get | degrees |
CutType | string | get | CabochonType name (“Cabochon”, “FlatTopSingleBevel”, …) |
GirdleAngle | double | get | degrees |
GirdleHeight | double | get | 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) |
Shape | string | get | CabochonShape name (“Round”, “Oval”, …) |
SizeX | double | get | millimetres |
SizeY | double | get | millimetres |
SizeZ | double | get | dome height, millimetres |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void Move(Vector3d translation) | (from IParametricObject) |
void SetAngle(double degrees) | 0 = straight wall |
void SetCutType(string cutType) | see CabochonApi.Types() |
void SetGirdleAngle(double degrees) | |
void SetGirdleHeight(double girdleHeight) | 0 = no girdle |
void SetShape(string shape) | see CabochonApi.Shapes() |
void SetSize(double x, double y, double z) | |
void SetSizeX(double x) | |
void SetSizeY(double y) | |
void SetSizeZ(double z) |