Scripting API
Channel
from ArtisanPlugin.Scripting import ChannelApi as channel
A channel setting is a groove cut between two metal walls, with a run of stones seated shoulder to shoulder inside it and no prongs between them - the classic way to line a band or a shoulder with small gems. The tool sweeps a CHANNEL_PROFILE section along an existing curve, packs the run of gems into the groove and bakes both together, exactly as the ArtisanChannel panel does.
This is a curve-driven, multi-gem setting: there is no mother gem. The parent of the whole run is curveId, which the group keeps as its link back to the rail.
Create
ids = channel.Create(curveId, gemSize = 0, width = 0, height = 0,
minDistance = 0, orientationIds = None,
profile = None) # -> object ids
| Parameter | Default | Meaning |
|---|---|---|
curveId | - | The rail the channel runs along - throws if the object is not a curve |
gemSize | 0 (tool default 1.8) | Size of each stone in the run, mm |
width | 0 (tool default 3) | Channel width, mm |
height | 0 (tool default 2) | Channel height, mm |
minDistance | 0 (tool default 0.1) | Minimum gap between consecutive stones, mm |
orientationIds | None | Surfaces, breps or meshes used to orient the channel onto the underlying body |
profile | None | CHANNEL_PROFILE asset by name - see AssetsApi.List("CHANNEL_PROFILE") |
All dimensions are millimetres, and 0 keeps the tool default for that parameter (or the user’s saved channel defaults), so you only pass what you actually mean to change. When profile is omitted the tool starts from the “domed rectangle” profile (asset 014) where it is available, and falls back to the type default otherwise.
The run mode follows the rail automatically, as it does in the panel: an open curve runs the channel as a single segment between the two ends, a closed curve carries it all the way around. Pass orientationIds when the channel has to sit on a body - the objects are meshed together and used to orient the sweep.
If the setting is configured with scalloped prongs and cutters are not being booleaned away, the prong cutters are baked into the same group as the rest.
Create throws if curveId is not a curve, if the geometry fails to compute with the given parameters, or if the licence is invalid.
Edit
There is no IChannel handle. Create returns a plain list of Rhino object ids - the channel metal first, then the gems, then any scalloped-prong cutters - all added to a single Rhino group tagged as a Channel, with the parameters and the parent curveId stored on the group.
That means you can move, transform or delete the ids like any other Rhino geometry, but you cannot re-drive the channel parametrically from a script. To change a dimension, delete the run and call Create again with the new values. Grouping is preserved, so selecting one member in Rhino selects the whole channel.
from ArtisanPlugin.Scripting import ChannelApi as channel, Transaction
with Transaction.Begin("Channel on the shoulder"):
ids = channel.Create(railId, gemSize = 1.6, width = 2.6, height = 1.8)
Mutations belong inside a Transaction so the whole build lands as one undo step.