Skip to content

Python package

ra.pearl

Pearls and their cups.

import rhinoartisan as ra

Wraps ArtisanPlugin.Scripting.PearlApi.

Functions

Function
all()Pearl handles for every object of this kind in the active document (empty when there is no document).
by_layer()Pearl 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()Creates a pearl (the ArtisanPearl tool, headless) and adds it to the active document.
find()The handle for id, or None when the id does not belong to an object of this kind.
selected()Pearls currently selected in the active doc.

ra.pearl.all()

ra.pearl.all() -> List[Pearl]

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

ra.pearl.by_layer()

ra.pearl.by_layer(layer_name: str) -> List[Pearl]

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

ParameterType
layer_namestrrequired

ra.pearl.count()

ra.pearl.count() -> int

Number of objects of this kind in the active document.

ra.pearl.create()

ra.pearl.create(diameter=None, calotte=None, calotte_angle=None, calotte_thickness=None, wire=None, wire_diameter=None, wire_length=None, plane=None) -> Pearl

Creates a pearl (the ArtisanPearl tool, headless) and adds it to the active document. A pearl is its own stone — a sphere placed on plane (omitted = world XY) — optionally baked together with two metal children, exactly like the panel’s Accept: a calotte (cup holding the pearl) and a wire (post drilled into it). The children become PearlCalotteCustomObject / PearlWireCustomObject instances linked to the pearl, on the metal layer with the metal material. All dimensional arguments are millimetres. Omit (None) to keep the tool’s default — or the user’s saved defaults — for that parameter (diameter 6, calotte_angle 35 degrees, calotte_thickness 1, wire_diameter 1, wire_length 8). calotte / wire omitted (None) keep the default (both enabled); pass False to skip that child. Throws InvalidOperationException when the geometry fails to compute (e.g. calotte thickness must be > 0.2 mm).

ParameterType
diameterfloatoptional — None = the tool default
calotteOptional[bool]optional — None = the tool default
calotte_anglefloatoptional — None = the tool default
calotte_thicknessfloatoptional — None = the tool default
wireOptional[bool]optional — None = the tool default
wire_diameterfloatoptional — None = the tool default
wire_lengthfloatoptional — None = the tool default
planeOptional[PlaneLike]optional — None = the tool default

ra.pearl.find()

ra.pearl.find(id: IdLike) -> Pearl

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

ParameterType
idIdLikerequired

ra.pearl.selected()

ra.pearl.selected() -> List[Pearl]

Pearls currently selected in the active doc. Empty list if nothing is selected or the selection contains no pearls.

Handles

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

Pearl (handle)

A pearl is its own stone (a sphere on a plane) with two optional metal children baked alongside it: a calotte (cup) and a wire (post). It is not built around a mother gem, so it extends ParametricObject directly and MotherGemId is always None. Read-only: the parametric engine has no Regenerate for pearls, so there are no in-place setters (recreate + Delete to change one).

PropertyTypeSettable
calotte_anglefloatdegrees
calotte_idstrNone when there is no calotte child
calotte_thicknessfloatmillimetres
diameterfloatpearl sphere diameter, millimetres
has_calotteboola calotte child was baked with this pearl
has_wireboola wire child was baked with this pearl
layer_namestr
mother_gem_idstr
object_typestr
positionPoint3d
wire_diameterfloatmillimetres
wire_idstrNone when there is no wire child
wire_lengthfloatmillimetres
Method
delete()
move(translation: VectorLike)

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