Python package
ra.micro_setting
Micro settings (micro-pave heads).
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.MicroSettingApi.
Functions
| Function | |
|---|---|
all() | A micro setting is baked as a GROUP carrying RaObjectUserData (both here and in the panel); nothing in the product ever creates a MicroSettingCustomObject, so resolving that type found nothing and every query below returned empty. |
by_layer() | MicroSetting 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 micro-setting (pavé infrastructure: cutters, V-cutters, optional channel and row prongs) for a run of small gems — the ArtisanMicroSetting tool, headless. |
find() | The handle for id, or None when the id does not belong to an object of this kind. |
selected() | MicroSettings currently selected in the active doc. |
ra.micro_setting.all()
ra.micro_setting.all() -> List[MicroSetting]
A micro setting is baked as a GROUP carrying RaObjectUserData (both here and in the panel); nothing in the product ever creates a MicroSettingCustomObject, so resolving that type found nothing and every query below returned empty.
ra.micro_setting.by_layer()
ra.micro_setting.by_layer(layer_name: str) -> List[MicroSetting]
MicroSetting handles on the layer with the given full path (empty when the layer does not exist).
| Parameter | Type | |
|---|---|---|
layer_name | str | required |
ra.micro_setting.count()
ra.micro_setting.count() -> int
Number of objects of this kind in the active document.
ra.micro_setting.create()
ra.micro_setting.create(gem_ids=None, cutters=None, v_cutters=None, channel=None, row_prongs=None, settings=None) -> List[str]
Builds the micro-setting (pavé infrastructure: cutters, V-cutters, optional channel and row prongs) for a run of small gems — the ArtisanMicroSetting tool, headless. gem_ids None/empty = the currently selected gems; at least one gem is required. The order of the ids is the order of the row. The enable flags default to the tool’s behavior (cutters and V-cutters on, channel and row prongs off); pass True/False to override, or None to keep the default (or the user’s saved defaults). settings is a JSON object with every other parameter, by section; only the keys given change, the rest keep the defaults: {“cutters”: {“start_width”: 0.8, “end_width”: 0.8, “shape”: “V_SHAPE”}, “v_cutters”: {“width_by_percentage”: True, “width_percentage”: 40, “length”: 2.5}, “channel”: {“enabled”: True, “width_by_percentage”: True, “width_percentage”: 80}, “row_prongs”: {“enabled”: True, “diameter”: 0.5, “end_prongs”: “One”}} The keys are the members of MicroSettingCutters, MicroSettingChannel and MicroSettingRowProngs in snake_case (millimetres; the percentages are percent of each gem’s size). A flag passed as an argument wins over “enabled” in settings. Returns the ids of every object baked (cutters, V-cutters, channel and prongs), all grouped under one MicroSetting group. Edit it afterwards through its handle (ra.micro_setting.find / All).
| Parameter | Type | |
|---|---|---|
gem_ids | Sequence[IdLike] | optional — None = the tool default |
cutters | Optional[bool] | optional — None = the tool default |
v_cutters | Optional[bool] | optional — None = the tool default |
channel | Optional[bool] | optional — None = the tool default |
row_prongs | Optional[bool] | optional — None = the tool default |
settings | str | optional — None = the tool default |
ra.micro_setting.find()
ra.micro_setting.find(id: IdLike) -> MicroSetting
The handle for id, or None when the id does not belong to an object of this kind.
| Parameter | Type | |
|---|---|---|
id | IdLike | required |
ra.micro_setting.selected()
ra.micro_setting.selected() -> List[MicroSetting]
MicroSettings currently selected in the active doc.
Handles
Objects returned by the functions above. Assigning a settable property regenerates the object; the change is one undo step inside ra.transaction().
MicroSetting (handle)
A micro setting: the cutters, V-cutters, channel and row prongs cut and built around a run of stones. Each block is a section mirroring the panel’s own. Every Set* rebuilds the micro-setting on the same gems, as editing it in the panel and accepting does: the handle (its Id) stays valid, the ids of the cutters, channel and prongs are new. A value that cannot be built throws and leaves the micro-setting as it was. To change several parameters with one rebuild use SetParameters.
| Property | Type | Settable | |
|---|---|---|---|
channel | MicroSettingChannel | ||
channel_enabled | bool | yes | |
cutters | MicroSettingCutters | ||
cutters_enabled | bool | yes | |
layer_name | str | ||
mother_gem_id | str | ||
object_type | str | ||
position | Point3d | ||
row_prongs | MicroSettingRowProngs | ||
row_prongs_enabled | bool | yes | |
v_cutters | MicroSettingCutters | ||
v_cutters_enabled | bool | yes |
| Method | |
|---|---|
delete() | |
move(translation: VectorLike) | |
set_parameters(settings: str) | Changes any number of parameters with ONE rebuild. |
Plus what every handle has: id, delete(), update(**kwargs), parameters(), equality and hashing by id, and raw (the underlying .NET object).
MicroSettingChannel (section)
The channel rail running under the stones.
| Property | Type | Settable | |
|---|---|---|---|
close | bool | yes | |
enabled | bool | yes | |
end_bend | float | yes | signed |
end_extension | float | yes | signed |
end_height | float | yes | |
end_over_girdle | float | yes | signed |
end_width | float | yes | |
extend_factor | float | yes | |
flat_ends | bool | yes | |
flip_cap_end | bool | yes | |
flip_cap_start | bool | yes | |
flip_end | bool | yes | |
flip_start | bool | yes | |
keep | bool | yes | |
precise | bool | yes | |
shape | str | yes | UShape, VShape, SquareShape, TrapezoidalShape, ChannelShape |
shape_factor | float | yes | |
start_bend | float | yes | signed |
start_extension | float | yes | signed |
start_height | float | yes | |
start_over_girdle | float | yes | signed |
start_width | float | yes | |
width_by_percentage | bool | yes | width sized as a % of each stone, one section per stone |
width_percentage | float | yes |
MicroSettingCutters (section)
The cutters carved under each stone. The same shape describes the plain CUTTERS and the V-CUTTERS; the members marked “cutters only” read as empty/0 on the V-cutters, which have no such parameter.
| Property | Type | Settable | |
|---|---|---|---|
enabled | bool | yes | |
end_height | float | yes | mm |
end_width | float | yes | mm |
keep | bool | yes | the cutter solids are kept instead of booleaned |
length | float | yes | mm |
over_girdle | float | yes | mm, signed |
over_girdle_middle | float | yes | mm, signed |
shape | str | yes | cutters only: U_SHAPE, V_SHAPE, SQUARE_SHAPE, TRAPEZOIDAL_SHAPE, FRENCH_SETTING_SHAPE |
shape_factor | float | yes | cutters only |
start_height | float | yes | mm |
start_width | float | yes | mm |
width_by_percentage | bool | yes | width sized as a % of each stone (V-cutters: of the two stones of the gap, averaged) |
width_percentage | float | yes | percent of the gem size, used when WidthByPercentage is on |
MicroSettingRowProngs (section)
The prongs shared between consecutive stones.
| Property | Type | Settable | |
|---|---|---|---|
allow_collisions | bool | yes | |
close | bool | yes | |
diameter | float | yes | mm |
diameter_by_percentage | bool | yes | diameter sized as a % of the gap between stones |
enabled | bool | yes | |
end_prongs | str | yes | Two, One, None: prongs closing the first and last stone of an open row |
height_over_girdle | float | yes | mm, signed |
height_under_girdle | float | yes | mm, signed |
inside_percentage | float | yes | |
position_by_percentage | bool | yes | prongs placed from the two gems of each gap instead of fixed offsets |
side_percentage | float | yes | distance from the row axis as a % of the gem radius |
smart_adapt | bool | yes | |
x_center_prongs | float | yes | mm, signed: offset of the prongs along the row |
y_center_prongs | float | yes | mm, signed: offset of the prongs across the row |