Python package
ra.class_ring
Class rings.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.ClassRingApi.
Functions
| Function | |
|---|---|
all() | ClassRing handles for every object of this kind in the active document (empty when there is no document). |
by_layer() | ClassRing 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 None when the id does not belong to an object of this kind. |
selected() | Class rings currently selected in the active doc. |
ra.class_ring.all()
ra.class_ring.all() -> List[ClassRing]
ClassRing handles for every object of this kind in the active document (empty when there is no document).
ra.class_ring.by_layer()
ra.class_ring.by_layer(layer_name: str) -> List[ClassRing]
ClassRing handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.class_ring.count()
ra.class_ring.count() -> int
Number of objects of this kind in the active document.
ra.class_ring.create()
ra.class_ring.create(top_width=None, top_height=None, depth=None, offset=None, stand_height=None, bottom_width=None, bottom_height=None, side_width=None, top_surface_height=None, angle=None, gem_shape=None, stone_type=None, cabochon_height=None, move_z=None, finger_diameter=None, plane=None, element=None) -> ClassRing
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; omitting keeps the tool default (or the user’s saved defaults). Top seat: top_width 2, top_height 3, depth 1, offset 1, stand_height 1. Shank: bottom_width 2, bottom_height 2, side_width 2, top_surface_height 1, angle 3 degrees. gem_shape ROUND | OVAL (default) | CUSHION; stone_type GEMSTONE (default) | CABOCHON with cabochon_height (2) and moveZ (stone lift, NaN = default 0). finger_diameter 0 = document ring size. plane omitted = world ZX (the tool’s own frame: finger axis along world Y). Returns an ClassRing handle to the new ring (its stone is a child). element = name of a saved element (ra.elements.list) to start from; explicit arguments override it.
| Parameter | Type | |
|---|---|---|
top_width | float | optional — None = the tool default |
top_height | float | optional — None = the tool default |
depth | float | optional — None = the tool default |
offset | float | optional — None = the tool default |
stand_height | float | optional — None = the tool default |
bottom_width | float | optional — None = the tool default |
bottom_height | float | optional — None = the tool default |
side_width | float | optional — None = the tool default |
top_surface_height | float | optional — None = the tool default |
angle | float | optional — None = the tool default |
gem_shape | str | optional — None = the tool default |
stone_type | str | optional — None = the tool default |
cabochon_height | float | optional — None = the tool default |
move_z | float | optional — None = the tool default |
finger_diameter | float | optional — None = the tool default |
plane | Optional[PlaneLike] | optional — None = the tool default |
element | str | optional — None = the tool default |
ra.class_ring.find()
ra.class_ring.find(id: IdLike) -> ClassRing
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.class_ring.selected()
ra.class_ring.selected() -> List[ClassRing]
Class rings currently selected in the active doc.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
ClassRing (handle)
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 | Settable | |
|---|---|---|---|
angle | float | yes | |
bottom_height | float | yes | |
bottom_width | float | yes | Shank (mm / degrees) |
cabochon_height | float | yes | |
children | List[str] | The baked stone (gem or cabochon brep), if any. | |
depth | float | yes | |
gem_shape | str | yes | Stone: “ROUND” | “OVAL” | “CUSHION”; “GEMSTONE” | “CABOCHON”. |
layer_name | str | ||
mother_gem_id | str | ||
move_z | float | yes | |
object_type | str | ||
offset | float | yes | |
position | Point3d | ||
ring_diameter_mm | float | ||
ring_size_label | str | ||
ring_size_region | str | ||
side_width | float | yes | |
stand_height | float | yes | |
stone_type | str | yes | |
top_height | float | yes | |
top_surface_height | float | yes | |
top_width | float | yes | Top seat (mm) |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_element(element: str) | Applies a saved ClassRing element (ra.elements.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). |
set_finger_diameter(finger_diameter: float) | |
set_gem(gem_shape=None, stone_type=None, cabochon_height=None, move_z=None) | |
set_shank(bottom_width=None, bottom_height=None, side_width=None, top_surface_height=None, angle=None) | |
set_top_side(top_width=None, top_height=None, depth=None, offset=None, stand_height=None) | Mutations regenerate the ring and its stone in place (same ring Guid; the stone gets a new id) and call LicenseGate.RequireValid() first. |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).