.NET API
AdvancedRingApi
Rings built from positioned sections along the finger curve.
from ArtisanPlugin.Scripting import AdvancedRingApi
See also the Python package, ra.advanced_ring.
Methods
| Method | |
|---|---|
All | IAdvancedRing handles for every object of this kind in the active document (empty when there is no document). |
ByLayer | IAdvancedRing 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 an advanced ring body (the ArtisanAdvancedRing tool, headless): a ring curve swept through profile sections placed along it. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
Selected | Advanced rings currently selected in the active doc. |
All
IReadOnlyList<IAdvancedRing> AdvancedRingApi.All()
IAdvancedRing handles for every object of this kind in the active document (empty when there is no document).
Returns IReadOnlyList<IAdvancedRing>.
ByLayer
IReadOnlyList<IAdvancedRing> AdvancedRingApi.ByLayer(string layerName)
IAdvancedRing handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<IAdvancedRing>.
Count
int AdvancedRingApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
IAdvancedRing AdvancedRingApi.Create(
IEnumerable<double> positions = null,
IEnumerable<double> widths = null,
IEnumerable<double> heights = null,
double width = 0,
double height = 0,
string sectionType = null,
double thickness = 0,
double comfort = 0,
string curveType = null,
double openingLength = 0,
double fingerDiameter = 0,
string profile = null,
Plane? plane = null,
string element = null)
Builds an advanced ring body (the ArtisanAdvancedRing tool, headless): a ring curve swept through profile sections placed along it. Each section sits at a normalized position t in 0..1 along the curve (0 = bottom of the finger, 0.5 = top) and has its own width/height. positions omitted = the user’s saved default sections, or two identical sections at t 0 and 0.5 (open curves: 0 and 1). widths / heights are per-section lists parallel to positions; width / height apply one value to every section (0 = section default 2.25 x 1.5 mm). sectionType COMFORT (default) | SOLID | THICKNESS with thickness (0.7) and comfort (0.3). curveType CLOSE (default) | OPEN | BYPASS | SHAPE, openingLength mm for the open types (5 / 14 / 14). fingerDiameter 0 = document ring size. profile = RING_PROFILE asset name. plane omitted = world XY. element = name of a saved AdvancedRing element (ElementsApi.List(“AdvancedRing”)) to start from; explicit arguments override it (its finger size is always replaced). Returns an IAdvancedRing handle to the new ring body.
| Parameter | Type | Default |
|---|---|---|
positions | IEnumerable<double> | null |
widths | IEnumerable<double> | null |
heights | IEnumerable<double> | null |
width | double | 0 |
height | double | 0 |
sectionType | string | null |
thickness | double | 0 |
comfort | double | 0 |
curveType | string | null |
openingLength | double | 0 |
fingerDiameter | double | 0 |
profile | string | null |
plane | Plane? | null |
element | string | null |
Returns IAdvancedRing.
Find
IAdvancedRing AdvancedRingApi.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 IAdvancedRing.
Selected
IReadOnlyList<IAdvancedRing> AdvancedRingApi.Selected()
Advanced rings currently selected in the active doc.
Returns IReadOnlyList<IAdvancedRing>.
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.
IAdvancedRing
Handle — extends IParametricObject.
Advanced ring body (the ArtisanAdvancedRing tool): a ring curve (closed / open / bypass / shape) swept through N profile sections, each placed at a normalized position t along the curve (0 = bottom of the finger, 0.5 = top). No single MotherGem.
| Property | Type | ||
|---|---|---|---|
CurveType | string | get | ”CLOSE”, “OPEN”, “BYPASS” or “SHAPE”. |
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) |
RingDiameterMm | double | get | |
RingSizeLabel | string | get | |
RingSizeRegion | string | get | |
SectionCount | int | get | |
SectionHeights | IReadOnlyList<double> | get | mm, same order |
SectionPositions | IReadOnlyList<double> | get | t of each section, sorted |
SectionWidths | IReadOnlyList<double> | get | mm, same order |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void Move(Vector3d translation) | (from IParametricObject) |
void SetAllSections(double width, double height) | |
void SetCurveType(string curveType) | CLOSE | OPEN | BYPASS | SHAPE |
void SetElement(string element) | Applies a saved AdvancedRing element (ElementsApi.List(“AdvancedRing”)) to this ring: its sections, curve and options replace the current ones, the ring size stays, and the ring regenerates in place (same id). |
void SetFingerDiameter(double fingerDiameter) | |
void SetHeight(double height) | every section |
void SetOpeningLength(double openingLength) | of the current open curve type |
void SetSection(int index, double width = 0, double height = 0) | Mutations regenerate the ring in place (same Guid) and call LicenseGate.RequireValid() first. Millimetres; 0 keeps the value. |
void SetSectionPosition(int index, double t) | |
void SetSectionRotation(int index, double degrees) | |
void SetWidth(double width) | every section |