.NET API
ChannelApi
Channel setting along a curve — the ArtisanChannel tool, headless: a metal channel with a run of gems inside, following an existing curve.
from ArtisanPlugin.Scripting import ChannelApi
See also the guide, Gemsets › Channel, and the Python package, ra.channel.
Methods
| Method | |
|---|---|
All | Channels are baked as groups carrying RaObjectUserData, so they resolve like the other group-based types. |
ByLayer | IChannel 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 curveId. |
Find | The handle for id, or null when the id does not belong to an object of this kind. |
ForCurve | The channels built on curveId. |
Selected | IChannel handles for the objects of this kind currently selected in the active document. |
All
IReadOnlyList<IChannel> ChannelApi.All()
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.
Returns IReadOnlyList<IChannel>.
ByLayer
IReadOnlyList<IChannel> ChannelApi.ByLayer(string layerName)
IChannel handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | Default |
|---|---|---|
layerName | string | required |
Returns IReadOnlyList<IChannel>.
Count
int ChannelApi.Count()
Number of objects of this kind in the active document.
Returns int.
Create
IReadOnlyList<Guid> ChannelApi.Create(
Guid curveId,
double gemSize = 0,
double width = 0,
double height = 0,
double minDistance = 0,
IEnumerable<Guid> orientationIds = null,
string profile = null,
string prongType = null,
string gemShape = null,
string runMode = null,
double positionZ = double.NaN,
double rotation = double.NaN,
double gemInside = double.NaN,
double vertical = double.NaN,
bool? forceEvenNumber = null,
double prongHeight = 0)
Builds the channel along curveId. Millimetres; 0 keeps the tool default (or the user’s saved defaults): gemSize 1.8, width 3, height 2, minDistance 0.1. orientationIds 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 | Default |
|---|---|---|
curveId | Guid | required |
gemSize | double | 0 |
width | double | 0 |
height | double | 0 |
minDistance | double | 0 |
orientationIds | IEnumerable<Guid> | null |
profile | string | null |
prongType | string | null |
gemShape | string | null |
runMode | string | null |
positionZ | double | double.NaN |
rotation | double | double.NaN |
gemInside | double | double.NaN |
vertical | double | double.NaN |
forceEvenNumber | bool? | null |
prongHeight | double | 0 |
Returns IReadOnlyList<Guid>.
Find
IChannel ChannelApi.Find(Guid id)
The handle for id, or null when the id does not belong to an object of this kind.
| Parameter | Type | Default |
|---|---|---|
id | Guid | required |
Returns IChannel.
ForCurve
IReadOnlyList<IChannel> ChannelApi.ForCurve(Guid curveId)
The channels built on curveId.
| Parameter | Type | Default |
|---|---|---|
curveId | Guid | required |
Returns IReadOnlyList<IChannel>.
Selected
IReadOnlyList<IChannel> ChannelApi.Selected()
IChannel handles for the objects of this kind currently selected in the active document.
Returns IReadOnlyList<IChannel>.
Handles and sections
What the methods above hand back. A handle’s setters regenerate the object; wrap changes in a Transaction so they land as one undo step.
IChannel
Handle — extends IParametricObject.
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 | ||
|---|---|---|---|
AutomaticProngSize | bool | get | |
BooleanCutters | bool | get | |
BrightCut | double | get | |
CurveId | Guid | get | Rhino id of the curve the channel was built on. |
FilletFactor | double | get | |
FlipCurve | bool | get | reverse the stone order and start point |
ForceEvenNumber | bool | get | |
GemInside | double | get | signed |
GemShape | string | get | The stones and how they are held. “ROUND” or “PRINCESS” |
GemSize | double | get | |
Height | double | get | |
Id | Guid | get | (from IParametricObject) |
InnerHeight | double | get | |
InnerWidth | double | get | |
InvertSegment | bool | get | closed curve: take the other arc |
LayerName | string | get | (from IParametricObject) |
Margin | double | get | SEGMENT: gap left at each end, mm |
MinDistance | double | get | |
MotherGemId | Guid | get | (from IParametricObject) |
ObjectType | string | get | (from IParametricObject) |
Position | Point3d | get | (from IParametricObject) |
PositionZ | double | get | signed |
ProfileName | string | get | CHANNEL_PROFILE asset name |
ProngDistance | double | get | signed |
ProngEndMode | string | get | ”SINGLE” or “DOUBLE” |
ProngExternalDiameter | double | get | |
ProngHeight | double | get | |
ProngInternalDiameter | double | get | |
ProngType | string | get | ”NONE”, “SHARED” or “SCALLOPED” |
Rotation | double | get | degrees, signed |
RunMode | string | get | How much of the curve is used: “FULL” (the whole loop) or “SEGMENT”. |
Vertical | double | get | signed |
Width | double | get | The metal rail section. |
| Method | |
|---|---|
void Delete() | (from IParametricObject) |
void Move(Vector3d translation) | (from IParametricObject) |
void SetAutomaticProngSize(bool automatic) | |
void SetBooleanCutters(bool booleanCutters) | |
void SetBrightCut(double brightCut) | |
void SetFilletFactor(double factor) | |
void SetFlipCurve(bool flip) | |
void SetForceEvenNumber(bool forceEven) | |
void SetGemInside(double gemInside) | signed |
void SetGemShape(string shape) | ROUND | PRINCESS |
void SetGemSize(double size) | |
void SetHeight(double height) | |
void SetInnerHeight(double height) | |
void SetInnerWidth(double width) | |
void SetInvertSegment(bool invert) | |
void SetMargin(double margin) | |
void SetMinDistance(double distance) | |
void SetPositionZ(double positionZ) | signed |
void SetProfile(string assetName) | CHANNEL_PROFILE asset |
void SetProngDiameters(double external, double internalDiameter) | |
void SetProngDistance(double distance) | signed |
void SetProngEndMode(string endMode) | SINGLE | DOUBLE |
void SetProngHeight(double height) | |
void SetProngType(string prongType) | NONE | SHARED | SCALLOPED |
void SetRotation(double degrees) | signed |
void SetRunMode(string runMode) | FULL | SEGMENT |
void SetVertical(double vertical) | signed |
void SetWidth(double width) |