Python package
ra.basket
Basket settings: prongs, upper and base rails.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.BasketApi, ArtisanPlugin.Scripting.BasketUpdateApi.
Functions
| Function | |
|---|---|
all() | Basket handles for every object of this kind in the active document (empty when there is no document). |
by_gem_material() | |
by_layer() | Basket 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 basket setting under an existing gem — the ArtisanBasket tool, headless. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
for_gem() | Basket handles whose mother gem is gem_id (empty for None). |
selected() | Baskets currently selected in the active doc. |
update_legacy_baskets() | The ArtisanBasketUpdate command, headless: finds every legacy basket (one object carrying “ObjectType = Basket” + parameters in its geometry dictionary, as saved by old Artisan versions, hidden or not), recomputes it against its mother gem with the current kernel and replaces it by the modern editable “Basket” group (metal material, RaObjectUserData with the parameters and the mother). |
ra.basket.all()
ra.basket.all() -> List[Basket]
Basket handles for every object of this kind in the active document (empty when there is no document).
ra.basket.by_gem_material()
ra.basket.by_gem_material(material_name: str) -> List[Basket]
| Parameter | Type | |
|---|---|---|
material_name | str | required |
ra.basket.by_layer()
ra.basket.by_layer(layer_name: str) -> List[Basket]
Basket handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.basket.count()
ra.basket.count() -> int
Number of objects of this kind in the active document.
ra.basket.create()
ra.basket.create(gem_ids=None, prongs=None, prong_diameter=None, prong_height=None, prong_height_over_girdle=None, gem_inside=None, upper_rail=None, base_rail=None, support=None, prong_mode=None, prong_profile=None, prong_diameter_bottom=None, prong_rotation=None, straight_prong=None, support_width=None, support_thickness=None, upper_rail_width=None, upper_rail_height=None, upper_rail_height_under_girdle=None, upper_rail_gem_size_percentage=None, upper_rail_profile=None, base_rail_width=None, base_rail_height=None, base_rail_move_in_z=None, base_rail_gem_size_percentage=None, base_rail_profile=None, element=None) -> List[Basket]
Builds a basket setting under an existing gem — the ArtisanBasket tool, headless. One basket (its own group) per gem; gem_ids None/empty = the currently selected gems. Millimetres; omitting keeps the tool default (or the user’s saved defaults): prong_diameter 1.5 (sets top/girdle/bottom together), prong_height 4, prong_height_over_girdle 0.3. prongs 0 keeps the default (4 rotated); positive/negative counts follow the tool (negative = rotated variant). gem_inside defaults to 0.35. upper_rail/base_rail None keep the defaults (both enabled). support is NONE (default), SINGLE or DOUBLE. Returns one Basket handle per gem, in input order. element = name of a saved element (ra.elements.list) to start from; explicit arguments override it.
| Parameter | Type | |
|---|---|---|
gem_ids | Sequence[IdLike] | optional — None = the tool default |
prongs | int | optional — None = the tool default |
prong_diameter | float | optional — None = the tool default |
prong_height | float | optional — None = the tool default |
prong_height_over_girdle | float | optional — None = the tool default |
gem_inside | float | optional — None = the tool default |
upper_rail | Optional[bool] | optional — None = the tool default |
base_rail | Optional[bool] | optional — None = the tool default |
support | str | optional — None = the tool default |
prong_mode | str | optional — None = the tool default |
prong_profile | str | optional — None = the tool default |
prong_diameter_bottom | float | optional — None = the tool default |
prong_rotation | float | optional — None = the tool default |
straight_prong | Optional[bool] | optional — None = the tool default |
support_width | float | optional — None = the tool default |
support_thickness | float | optional — None = the tool default |
upper_rail_width | float | optional — None = the tool default |
upper_rail_height | float | optional — None = the tool default |
upper_rail_height_under_girdle | float | optional — None = the tool default |
upper_rail_gem_size_percentage | float | optional — None = the tool default |
upper_rail_profile | str | optional — None = the tool default |
base_rail_width | float | optional — None = the tool default |
base_rail_height | float | optional — None = the tool default |
base_rail_move_in_z | float | optional — None = the tool default |
base_rail_gem_size_percentage | float | optional — None = the tool default |
base_rail_profile | str | optional — None = the tool default |
element | str | optional — None = the tool default |
ra.basket.find()
ra.basket.find(id: IdLike) -> Basket
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.basket.for_gem()
ra.basket.for_gem(gem_id: IdLike) -> List[Basket]
Basket handles whose mother gem is gem_id (empty for None).
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
ra.basket.selected()
ra.basket.selected() -> List[Basket]
Baskets currently selected in the active doc.
ra.basket.update_legacy_baskets()
ra.basket.update_legacy_baskets() -> List[str]
The ArtisanBasketUpdate command, headless: finds every legacy basket (one object carrying “ObjectType = Basket” + parameters in its geometry dictionary, as saved by old Artisan versions, hidden or not), recomputes it against its mother gem with the current kernel and replaces it by the modern editable “Basket” group (metal material, RaObjectUserData with the parameters and the mother). Baskets whose mother gem is gone or that fail to compute are left untouched. Returns the ids of the new baskets (ra.basket.find / handles); empty when the document has no legacy baskets.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
Basket (handle)
| Property | Type | Settable | |
|---|---|---|---|
base_rail | BasketRail | ||
gem_carat_weight | float | ||
gem_material | str | ||
gem_shape | str | ||
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
position | Point3d | ||
prong | BasketProng | The rest of the tool’s parameters, grouped as the panel groups them. | |
prong_count | int | yes | signed: negative = the rotated layout |
prong_diameter_bottom | float | ||
prong_diameter_girdle | float | ||
prong_diameter_top | float | ||
prong_height | float | yes | |
prongs_rotated | bool | ||
upper_rail | BasketRail |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_element(element: str) | Applies a saved Basket element (ra.elements.list(“Basket”)) to this basket: its parameters replace the current ones, the mother gem stays, and the basket regenerates in place (same id). |
set_prong_diameter(diameter: float) | writes all three diameters |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).
BasketRail (section)
One of the basket’s two rails. The upper rail additionally carries the chamfer; the base rail carries its vertical offset. Members that do not apply to a rail throw NotSupportedException rather than silently doing nothing.
| Property | Type | Settable | |
|---|---|---|---|
chamfer | bool | yes | upper rail only |
chamfer_offset | float | yes | upper rail only |
enabled | bool | yes | |
gem_size_percentage | float | yes | rail diameter as % of the gem |
height | float | yes | mm |
height_under_girdle | float | yes | upper rail only |
mode | str | yes | DEFAULT (elliptical section) or CUSTOM (the CLOSED_PROFILE) |
move_in_z | float | yes | base rail only, signed |
profile_name | str | CLOSED_PROFILE asset name | |
rotation | float | yes | degrees, signed |
width | float | yes | mm |
| Method | |
|---|---|
set_profile(asset_name: str) | also switches the rail to CUSTOM mode, where the profile is used |
BasketProng (section)
The prongs and their support posts.
| Property | Type | Settable | |
|---|---|---|---|
bottom_rail_inside | float | yes | |
cap_bump | float | yes | mm |
claw_gem_inside | float | yes | Claw mode only. |
claw_height | float | yes | signed |
claw_on_curve | int | yes | panel range 1-30 |
claw_tension | float | yes | |
count | int | yes | negative = the rotated layout |
diameter_bottom | float | yes | mm |
diameter_top | float | yes | mm |
extension_for_manufacturing | float | yes | |
gem_inside | float | yes | mm, signed |
height | float | yes | mm |
height_over_girdle | float | yes | mm |
mode | str | yes | ”DEFAULT” | “CUSTOM” | “CLAW” |
profile_name | str | CLOSED_PROFILE asset name, "" when unset | |
rotation | float | yes | degrees, signed |
straight | bool | yes | straight vs curved prong body |
support | str | yes | ”NONE” | “SINGLE” | “DOUBLE” |
support_thickness | float | yes | mm |
support_width | float | yes | mm |
| Method | |
|---|---|
set_profile(asset_name: str) | CLOSED_PROFILE asset |