Skip to content

.NET API

RelationsApi

The parametric RELATIONS between Artisan objects: the mother/child adoption the engine keeps (a bezel follows its gem, a rope its curve) and the “apply this element to other mothers” command. Every method here calls LicenseGate.RequireValid() first and ends with a viewport redraw.

from ArtisanPlugin.Scripting import RelationsApi

See also the Python package, ra.relations.

Methods

Method
ApplyElementThe ArtisanApplyElement command, headless: takes the parameters of one existing Artisan element in the document (sourceId: 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…).
MeetMothersAndChildrenRe-matches every parametric child with its mother, exactly like the ArtisanRefreshRelations command (and the Yes branch of ArtisanMeetMothersAndChildrenCommand): each bezel, cutter, halo, rope…

ApplyElement

IReadOnlyList<Guid> RelationsApi.ApplyElement(Guid sourceId, IEnumerable<Guid> targetIds)

The ArtisanApplyElement command, headless: takes the parameters of one existing Artisan element in the document (sourceId: 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).

ParameterTypeDefault
sourceIdGuidrequired
targetIdsIEnumerable<Guid>required

Returns IReadOnlyList<Guid>.

MeetMothersAndChildren

void RelationsApi.MeetMothersAndChildren()

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 DocumentApi.RefreshAll (that regenerates the geometry of pending children); run this first, then RefreshAll if the geometry must be rebuilt. The transform facades already run it.