Python package
ra.relations
Parent/child relations between parametric objects.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.RelationsApi.
Functions
| Function | |
|---|---|
apply_element() | The ArtisanApplyElement command, headless: takes the parameters of one existing Artisan element in the document (source_id: a member of a parametric group — Halo, Cluster, Basket, AdvancedBasket, Tulip, Martini, TrellisGemset, Gems on Curve, Advanced Gems on Curve, MicroSetting — or a parametric custom object: Bezel, Cutter, Peghead, Rope, Milgrain, SmartProfile) and builds the same element on each target mother, with the very bake of the command (group + RaObjectUserData, metal materials, gems layer…). |
meet_mothers_and_children() | Re-matches every parametric child with its mother, exactly like the ArtisanRefreshRelations command (and the Yes branch of ArtisanMeetMothersAndChildrenCommand): each bezel, cutter, halo, rope… |
ra.relations.apply_element()
ra.relations.apply_element(source_id: IdLike, target_ids: Sequence[IdLike]) -> List[str]
The ArtisanApplyElement command, headless: takes the parameters of one existing Artisan element in the document (source_id: a member of a parametric group — Halo, Cluster, Basket, AdvancedBasket, Tulip, Martini, TrellisGemset, Gems on Curve, Advanced Gems on Curve, MicroSetting — or a parametric custom object: Bezel, Cutter, Peghead, Rope, Milgrain, SmartProfile) and builds the same element on each target mother, with the very bake of the command (group + RaObjectUserData, metal materials, gems layer…). Targets are gems for the gem-based elements and curves for the curve-based ones (Rope, Milgrain, SmartProfile, Gems on Curve); a MicroSetting takes the whole target list as ONE gem row. This is “copy the setting of that gem onto these gems” — it reads the element in the document, not the saved library (see ElementsApi for presets). Returns the ids of every object created (the members of each new element).
| Parameter | Type | |
|---|---|---|
source_id | IdLike | required |
target_ids | Sequence[IdLike] | required |
ra.relations.meet_mothers_and_children()
ra.relations.meet_mothers_and_children()
Re-matches every parametric child with its mother, exactly like the ArtisanRefreshRelations command (and the Yes branch of ArtisanMeetMothersAndChildrenCommand): each bezel, cutter, halo, rope… re-adopts the nearest gem / curve as mother, so children moved or copied with native Rhino commands follow the right mother again. This is NOT ra.document.refresh_all (that regenerates the geometry of pending children); run this first, then RefreshAll if the geometry must be rebuilt. The transform facades already run it.