Python package
ra.advanced_basket
Baskets with independent prong and rail profiles.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.AdvancedBasketApi.
Functions
| Function | |
|---|---|
all() | AdvancedBasket handles for every object of this kind in the active document (empty when there is no document). |
by_layer() | AdvancedBasket 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 basket setting under an existing gem — the ArtisanAdvancedBasket tool, headless. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
for_gem() | AdvancedBasket handles whose mother gem is gem_id (empty for None). |
presets() | The prong layouts the tool ships for a gem shape, by name — the same list the panel draws as its preset row. |
selected() | Advanced baskets currently selected in the active doc. |
ra.advanced_basket.all()
ra.advanced_basket.all() -> List[AdvancedBasket]
AdvancedBasket handles for every object of this kind in the active document (empty when there is no document).
ra.advanced_basket.by_layer()
ra.advanced_basket.by_layer(layer_name: str) -> List[AdvancedBasket]
AdvancedBasket handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.advanced_basket.count()
ra.advanced_basket.count() -> int
Number of objects of this kind in the active document.
ra.advanced_basket.create()
ra.advanced_basket.create(gem_ids=None, prongs=None, prong_mode=None, prong_diameter=None, prong_height=None, rails=None, rail_width=None, profile=None, preset=None, positions=None, element=None) -> List[AdvancedBasket]
Builds an advanced basket setting under an existing gem — the ArtisanAdvancedBasket tool, headless. One basket (its own group) per gem; gem_ids None/empty = the currently selected gems. Unlike the basic Basket, the advanced basket is a free layout: a list of individually placed prongs plus a list of rails. This facade lays both out evenly, like the tool’s presets. Millimetres; 0/None keeps the tool default (or the user’s saved defaults): prongs 0 keeps the saved layout, or 4 prongs at the diagonals when there is none (the tool’s “4” preset); a positive count places that many prongs evenly around the gem. prong_mode None = ROUND; also DOUBLE (the 2-2 presets), TRIPLE (3-3), CLAW, OFFSET or CUSTOM, applied to every prong. prong_diameter 0 keeps 1.5 (sets top and bottom together), prong_height 0 keeps 4. rails None keeps the saved rails (a fresh basket has none); 0 = no rails, 1 = one rail 1 mm under the girdle, 2 adds a second at 3.66 (the tool’s 1-rail / 2-rail presets; more keep the same spacing). rail_width 0 keeps 1.5, applied to every rail. profile names a CLOSED_PROFILE asset for the prongs (see ra.assets.list) and switches them to CUSTOM mode unless prong_mode says otherwise; None keeps each mode’s built-in section. Returns one AdvancedBasket 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_mode | str | optional — None = the tool default |
prong_diameter | float | optional — None = the tool default |
prong_height | float | optional — None = the tool default |
rails | Optional[int] | optional — None = the tool default |
rail_width | float | optional — None = the tool default |
profile | str | optional — None = the tool default |
preset | str | optional — None = the tool default |
positions | Sequence[float] | optional — None = the tool default |
element | str | optional — None = the tool default |
ra.advanced_basket.find()
ra.advanced_basket.find(id: IdLike) -> AdvancedBasket
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.advanced_basket.for_gem()
ra.advanced_basket.for_gem(gem_id: IdLike) -> List[AdvancedBasket]
AdvancedBasket handles whose mother gem is gem_id (empty for None).
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
ra.advanced_basket.presets()
ra.advanced_basket.presets(gem_id: IdLike) -> List[str]
The prong layouts the tool ships for a gem shape, by name — the same list the panel draws as its preset row. Pass one of these as Create’s preset. Names look like “4”, “4-V”, “2-2”, “3-3”, “6”, “8” or “NONE”; which ones exist depends on the shape (an emerald gets corner layouts, a marquise gets tip layouts…).
| Parameter | Type | |
|---|---|---|
gem_id | IdLike | required |
ra.advanced_basket.selected()
ra.advanced_basket.selected() -> List[AdvancedBasket]
Advanced baskets 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().
AdvancedBasket (handle)
| Property | Type | Settable | |
|---|---|---|---|
gem_carat_weight | float | ||
gem_material | str | ||
gem_shape | str | ||
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
position | Point3d | ||
prong_count | int | yes | Unlike the basic Basket, the advanced basket stores one entry per prong/rail, each with its own settings. The scalar getters report the first prong’s values (0 when there are none). |
prong_diameter | float | yes | |
prong_height | float | yes | |
rail_count | int | yes |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_element(element: str) | Applies a saved AdvancedBasket element (ra.elements.list(“AdvancedBasket”)) to this basket: its prongs and rails replace the current ones, re-seeded onto the mother gem (which stays) so the layout keeps its direction on this cut, and the basket regenerates in place (same id). |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).