Skip to content

Python package

ra.gem_size

Stones by millimetre size instead of carats.

import rhinoartisan as ra

Wraps ArtisanPlugin.Scripting.GemSizeApi.

Functions

Function
create()Creates a gem from its dimensions in mm and adds it to the active document, returning the same Gem handle ra.gems.create returns.
same_size()The actual ArtisanGemBySize command: given some reference gems, finds every gem in the document with the same width (SizeX, 0.001 mm tolerance) — e.g.

ra.gem_size.create()

ra.gem_size.create(shape: str, material: str, size_x: float, size_y=None, size_z=None, plane=None) -> Gem

Creates a gem from its dimensions in mm and adds it to the active document, returning the same Gem handle ra.gems.create returns. shape / material accept the GemApi vocabularies (ra.gems.shapes() / ra.gems.materials()). sizeX is the width (diameter for ROUND); sizeY (length) and sizeZ (depth) 0 = the shape’s standard proportions. plane is where the gem sits (default: world XY at the origin); the carat weight is derived from the mesh volume.

ParameterType
shapestrrequired
materialstrrequired
size_xfloatrequired
size_yfloatoptional — None = the tool default
size_zfloatoptional — None = the tool default
planeOptional[PlaneLike]optional — None = the tool default

ra.gem_size.same_size()

ra.gem_size.same_size(gem_ids=None) -> List[str]

The actual ArtisanGemBySize command: given some reference gems, finds every gem in the document with the same width (SizeX, 0.001 mm tolerance) — e.g. “all the 1.5 mm stones”. gem_ids empty/None uses the selected gems. Read-only, no license: returns the matching ids (reference gems included); pair with select_objects / ra.gems.find.

ParameterType
gem_idsSequence[IdLike]optional — None = the tool default

Handles

Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().

Gem (handle)

Public scripting view of a gem placed in the current RhinoDoc. This is intentionally narrow — it does NOT expose the underlying ShapesKernel GemObject. The LLM-generated Python scripts (and any third party) can only do what this surface allows, and every mutation passes through LicenseGate.

PropertyTypeSettable
carat_weightfloatyes
layer_namestr
materialstryescompound name, e.g. “Diamond”
planePlaneyesthe gem’s full placement plane (origin + orientation)
positionPoint3dorigin of the gem’s plane
shapestr”ROUND”, “PRINCESS”, “MARQUISE”, …
size_xfloatmm
size_yfloatmm
size_zfloatmm
Method
copy(translation=None) -> Gemduplicate displaced by translation, returns the new gem
delete()
flip()turn the gem upside down (180° around its own X axis)
move(translation: VectorLike)
rotate(degrees: float)spin around the gem’s own Z axis (positive = counter-clockwise)
scale(factor: float)uniform scale of the current size (factor > 0)
select(on: bool)Selection state in the viewport.
set_size(size_x: float, size_y: float, size_z: float)resize to explicit mm dimensions

Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).