.NET API
ClassRingApi
Class rings.
from ArtisanPlugin.Scripting import ClassRingApi
See also the Python package, ra.class_ring.
Methods
| Method | |
|---|---|
All | IClassRing handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | IClassRing 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 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. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
Selected | Class 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).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
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).
| Parameter | Type | Default |
|---|---|---|
topWidth | double | 0 |
topHeight | double | 0 |
depth | double | 0 |
offset | double | 0 |
standHeight | double | 0 |
bottomWidth | double | 0 |
bottomHeight | double | 0 |
sideWidth | double | 0 |
topSurfaceHeight | double | 0 |
angle | double | 0 |
gemShape | string | null |
stoneType | string | null |
cabochonHeight | double | 0 |
moveZ | double | double.NaN |
fingerDiameter | double | 0 |
plane | Plane? | null |
element | string | null |
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.
| Parameter | Type | Default |
|---|---|---|
id | Guid | required |
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.
| Property | Type | ||
|---|---|---|---|
Angle | double | get | |
BottomHeight | double | get | |
BottomWidth | double | get | Shank (mm / degrees) |
CabochonHeight | double | get | |
Children | IReadOnlyList<Guid> | get | The baked stone (gem or cabochon brep), if any. |
Depth | double | get | |
GemShape | string | get | Stone: “ROUND” | “OVAL” | “CUSHION”; “GEMSTONE” | “CABOCHON”. |
Id | Guid | get | (from IParametricObject) |
LayerName | string | get | (from IParametricObject) |
MotherGemId | Guid | get | (from IParametricObject) |
MoveZ | double | get | |
ObjectType | string | get | (from IParametricObject) |
Offset | double | get | |
Position | Point3d | get | (from IParametricObject) |
RingDiameterMm | double | get | |
RingSizeLabel | string | get | |
RingSizeRegion | string | get | |
SideWidth | double | get | |
StandHeight | double | get | |
StoneType | string | get | |
TopHeight | double | get | |
TopSurfaceHeight | double | get | |
TopWidth | double | get | Top 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). |