Skip to content

.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
AllICabochon handles for every object of this kind in the active document (empty when there is no document).
ByLayerICabochon 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.
CreateCreates a cabochon stone (the ArtisanCabochon tool, headless) and adds it to the active document.
FindThe handle for id, or null when the id does not belong to an object of this kind.
SelectedCabochons 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).

ParameterTypeDefault
layerNamestringrequired

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.

ParameterTypeDefault
xdouble0
ydouble0
zdouble0
shapestringnull
typestringnull
angledouble?null
girdleHeightdouble?null
planePlane?null
girdleAngledouble?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.

ParameterTypeDefault
idGuidrequired

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.

PropertyType
Angledoublegetdegrees
CutTypestringgetCabochonType name (“Cabochon”, “FlatTopSingleBevel”, …)
GirdleAngledoublegetdegrees
GirdleHeightdoublegetmillimetres
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
ObjectTypestringget(from IParametricObject)
PositionPoint3dget(from IParametricObject)
ShapestringgetCabochonShape name (“Round”, “Oval”, …)
SizeXdoublegetmillimetres
SizeYdoublegetmillimetres
SizeZdoublegetdome 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)