Skip to content

.NET API

ClassRingApi

Class rings.

from ArtisanPlugin.Scripting import ClassRingApi

See also the Python package, ra.class_ring.

Methods

Method
AllIClassRing handles for every object of this kind in the active document (empty when there is no document).
ByLayerIClassRing 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 class ring (the ArtisanClassRing tool, headless): a heavy signet-style body with a flat top seat and one stone on it — a faceted gem or a cabochon, regenerated with the ring.
FindThe handle for id, or null when the id does not belong to an object of this kind.
SelectedClass rings currently selected in the active doc.

All

IReadOnlyList<IClassRing> ClassRingApi.All()

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

Returns IReadOnlyList<IClassRing>.

ByLayer

IReadOnlyList<IClassRing> ClassRingApi.ByLayer(string layerName)

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

ParameterTypeDefault
layerNamestringrequired

Returns IReadOnlyList<IClassRing>.

Count

int ClassRingApi.Count()

Number of objects of this kind in the active document.

Returns int.

Create

IClassRing ClassRingApi.Create(
    double topWidth = 0,
    double topHeight = 0,
    double depth = 0,
    double offset = 0,
    double standHeight = 0,
    double bottomWidth = 0,
    double bottomHeight = 0,
    double sideWidth = 0,
    double topSurfaceHeight = 0,
    double angle = 0,
    string gemShape = null,
    string stoneType = null,
    double cabochonHeight = 0,
    double moveZ = double.NaN,
    double fingerDiameter = 0,
    Plane? plane = null,
    string element = null)

Builds a class ring (the ArtisanClassRing tool, headless): a heavy signet-style body with a flat top seat and one stone on it — a faceted gem or a cabochon, regenerated with the ring. Millimetres; 0 keeps the tool default (or the user’s saved defaults). Top seat: topWidth 2, topHeight 3, depth 1, offset 1, standHeight 1. Shank: bottomWidth 2, bottomHeight 2, sideWidth 2, topSurfaceHeight 1, angle 3 degrees. gemShape ROUND | OVAL (default) | CUSHION; stoneType GEMSTONE (default) | CABOCHON with cabochonHeight (2) and moveZ (stone lift, NaN = default 0). fingerDiameter 0 = document ring size. plane omitted = world ZX (the tool’s own frame: finger axis along world Y). element = name of a saved ClassRing element (ElementsApi.List(“ClassRing”)) to start from; explicit arguments override it (its finger size is always replaced). Returns an IClassRing handle to the new ring (its stone is a child).

ParameterTypeDefault
topWidthdouble0
topHeightdouble0
depthdouble0
offsetdouble0
standHeightdouble0
bottomWidthdouble0
bottomHeightdouble0
sideWidthdouble0
topSurfaceHeightdouble0
angledouble0
gemShapestringnull
stoneTypestringnull
cabochonHeightdouble0
moveZdoubledouble.NaN
fingerDiameterdouble0
planePlane?null
elementstringnull

Returns IClassRing.

Find

IClassRing ClassRingApi.Find(Guid id)

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

ParameterTypeDefault
idGuidrequired

Returns IClassRing.

Selected

IReadOnlyList<IClassRing> ClassRingApi.Selected()

Class rings currently selected in the active doc.

Returns IReadOnlyList<IClassRing>.

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.

IClassRing

Handle — extends IParametricObject.

Class ring (the ArtisanClassRing tool): a signet-like body with a flat top seat holding one stone (faceted gem or cabochon). The stone is a child object regenerated together with the ring — it is NOT a free-standing gem, so it has no MotherGem.

PropertyType
Angledoubleget
BottomHeightdoubleget
BottomWidthdoublegetShank (mm / degrees)
CabochonHeightdoubleget
ChildrenIReadOnlyList<Guid>getThe baked stone (gem or cabochon brep), if any.
Depthdoubleget
GemShapestringgetStone: “ROUND” | “OVAL” | “CUSHION”; “GEMSTONE” | “CABOCHON”.
IdGuidget(from IParametricObject)
LayerNamestringget(from IParametricObject)
MotherGemIdGuidget(from IParametricObject)
MoveZdoubleget
ObjectTypestringget(from IParametricObject)
Offsetdoubleget
PositionPoint3dget(from IParametricObject)
RingDiameterMmdoubleget
RingSizeLabelstringget
RingSizeRegionstringget
SideWidthdoubleget
StandHeightdoubleget
StoneTypestringget
TopHeightdoubleget
TopSurfaceHeightdoubleget
TopWidthdoublegetTop seat (mm)
Method
void Delete()(from IParametricObject)
void Move(Vector3d translation)(from IParametricObject)
void SetAngle(double angle)
void SetBottomHeight(double bottomHeight)
void SetBottomWidth(double bottomWidth)
void SetCabochonHeight(double cabochonHeight)
void SetDepth(double depth)
void SetElement(string element)Applies a saved ClassRing element (ElementsApi.List(“ClassRing”)) to this ring: its top, shank and stone replace the current ones, the ring size stays, and the ring and its stone regenerate in place (same id).
void SetFingerDiameter(double fingerDiameter)
void SetGem( string gemShape = null, string stoneType = null, double cabochonHeight = 0, double moveZ = double.NaN)
void SetGemShape(string gemShape)
void SetMoveZ(double moveZ)
void SetOffset(double offset)
void SetShank( double bottomWidth = 0, double bottomHeight = 0, double sideWidth = 0, double topSurfaceHeight = 0, double angle = 0)
void SetSideWidth(double sideWidth)
void SetStandHeight(double standHeight)
void SetStoneType(string stoneType)
void SetTopHeight(double topHeight)
void SetTopSide( double topWidth = 0, double topHeight = 0, double depth = 0, double offset = 0, double standHeight = 0)Mutations regenerate the ring and its stone in place (same ring Guid; the stone gets a new id) and call LicenseGate.RequireValid() first. Millimetres; 0 keeps the current value.
void SetTopSurfaceHeight(double topSurfaceHeight)
void SetTopWidth(double topWidth)Single-value shortcuts (the ones edit_object can drive).