Python package
ra.channel
Channel settings along a curve.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.ChannelApi.
Functions
| Function | |
|---|---|
all() | Channels are baked as groups carrying RaObjectUserData, so they resolve like the other group-based types. |
by_layer() | Channel 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 the channel along curve_id. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
for_curve() | The channels built on curve_id. |
selected() | Channel handles for the objects of this kind currently selected in the active document. |
ra.channel.all()
ra.channel.all() -> List[Channel]
Channels are baked as groups carrying RaObjectUserData, so they resolve like the other group-based types. Create returns the member ids; these return handles you can read and edit.
ra.channel.by_layer()
ra.channel.by_layer(layer_name: str) -> List[Channel]
Channel handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.channel.count()
ra.channel.count() -> int
Number of objects of this kind in the active document.
ra.channel.create()
ra.channel.create(curve_id: IdLike, gem_size=None, width=None, height=None, min_distance=None, orientation_ids=None, profile=None, prong_type=None, gem_shape=None, run_mode=None, position_z=None, rotation=None, gem_inside=None, vertical=None, force_even_number=None, prong_height=None) -> List[str]
Builds the channel along curve_id. Millimetres; omitting keeps the tool default (or the user’s saved defaults): gem_size 1.8, width 3, height 2, min_distance 0.1. orientation_ids optionally orient the channel onto those surfaces/breps. profile picks a CHANNEL_PROFILE asset by name; omitted = the tool’s default (the “domed rectangle” profile when available). Open curves run as a segment, closed curves all the way around, exactly like the tool. Returns the ids of the created objects (metal, then gems), all grouped as one editable Channel.
| Parameter | Type | |
|---|---|---|
curve_id | IdLike | required |
gem_size | float | optional — None = the tool default |
width | float | optional — None = the tool default |
height | float | optional — None = the tool default |
min_distance | float | optional — None = the tool default |
orientation_ids | Sequence[IdLike] | optional — None = the tool default |
profile | str | optional — None = the tool default |
prong_type | str | optional — None = the tool default |
gem_shape | str | optional — None = the tool default |
run_mode | str | optional — None = the tool default |
position_z | float | optional — None = the tool default |
rotation | float | optional — None = the tool default |
gem_inside | float | optional — None = the tool default |
vertical | float | optional — None = the tool default |
force_even_number | Optional[bool] | optional — None = the tool default |
prong_height | float | optional — None = the tool default |
ra.channel.find()
ra.channel.find(id: IdLike) -> Channel
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.channel.for_curve()
ra.channel.for_curve(curve_id: IdLike) -> List[Channel]
The channels built on curve_id.
| Parameter | Type | |
|---|---|---|
curve_id | IdLike | required |
ra.channel.selected()
ra.channel.selected() -> List[Channel]
Channel handles for the objects of this kind currently selected in the active document.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
Channel (handle)
A channel setting: the metal rail built along a curve plus the run of stones set into it. Setters regenerate it in place (the group keeps its id) and take LITERAL values — 0 and negatives are allowed where the parameter is signed.
| Property | Type | Settable | |
|---|---|---|---|
automatic_prong_size | bool | yes | |
boolean_cutters | bool | yes | |
bright_cut | float | yes | |
curve_id | str | Rhino id of the curve the channel was built on. | |
fillet_factor | float | yes | |
flip_curve | bool | yes | reverse the stone order and start point |
force_even_number | bool | yes | |
gem_inside | float | yes | signed |
gem_shape | str | yes | The stones and how they are held. “ROUND” or “PRINCESS” |
gem_size | float | yes | |
height | float | yes | |
inner_height | float | yes | |
inner_width | float | yes | |
invert_segment | bool | yes | closed curve: take the other arc |
layer_name | str | ||
margin | float | yes | SEGMENT: gap left at each end, mm |
min_distance | float | yes | |
mother_gem_id | str | ||
object_type | str | ||
position | Point3d | ||
position_z | float | yes | signed |
profile_name | str | CHANNEL_PROFILE asset name | |
prong_distance | float | yes | signed |
prong_end_mode | str | yes | ”SINGLE” or “DOUBLE” |
prong_external_diameter | float | ||
prong_height | float | yes | |
prong_internal_diameter | float | ||
prong_type | str | yes | ”NONE”, “SHARED” or “SCALLOPED” |
rotation | float | yes | degrees, signed |
run_mode | str | yes | How much of the curve is used: “FULL” (the whole loop) or “SEGMENT”. |
vertical | float | yes | signed |
width | float | yes | The metal rail section. |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_profile(asset_name: str) | CHANNEL_PROFILE asset |
set_prong_diameters(external: float, internal_diameter: float) |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).