Scripting API
Micro setting
from ArtisanPlugin.Scripting import MicroSettingApi as micro
Micro setting is the metalwork that makes a run of small stones sit properly: a seat cut under each stone, a V-groove between them, optionally a channel wall along the run and prongs raised over the row. It does not create the gems - you place those first, then this tool builds the infrastructure around them, exactly as the ArtisanMicroSetting panel does.
This is a multi-gem object driven by a run of existing stones, so MotherGemId is empty by design; the parent stones are kept on the group as motherGems.
Create
ids = micro.Create(gemIds = None, cutters = None, vCutters = None,
channel = None, rowProngs = None) # -> object ids
| Parameter | Default | Meaning |
|---|---|---|
gemIds | None | The run of gems to set; None or empty uses the current selection. At least one is required, and every id must be a gem |
cutters | None (tool default on) | Seat cutter under each stone |
vCutters | None (tool default on) | V-cutters between the stones |
channel | None (tool default off) | Channel wall along the run |
rowProngs | None (tool default off) | Prongs raised over the row |
The four flags are nullable on purpose: pass True or False to force an element on or off, or leave them None to keep the tool’s behaviour - or the user’s saved micro-setting defaults where they exist. Every numeric parameter of the setting stays at its tool default; there is no way to override those from the script API.
Create returns the ids of every object baked - cutters, V-cutters, the channel brep and the row prongs - each kind in its own Rhino sub-group, with the whole lot collected under one master MicroSetting group carrying the parameters and the parent gems.
Create throws if no gems are given or selected, if any id is not a gem, if the computation fails with the given parameters, or if nothing at all was produced - which normally means every element was disabled.
from ArtisanPlugin.Scripting import MicroSettingApi as micro, Transaction
with Transaction.Begin("Micro set the row"):
ids = micro.Create(rowGemIds, channel = True, rowProngs = True)
Mutations belong inside a Transaction so the whole build lands as one undo step.
Edit
The IMicroSetting handle is query-only - it has no setters. Once a micro setting exists you can read how it was configured and where it sits, but changing it means deleting it and calling Create again with different flags.
| Property | Meaning |
|---|---|
ChannelEnabled | Whether the setting carries a channel wall |
RowProngsEnabled | Whether the setting carries row prongs |
CuttersCount | 1 when the setting has a cutters block, 0 otherwise |
VCuttersCount | 1 when the setting has a V-cutters block, 0 otherwise |
CuttersCount and VCuttersCount report the presence of the model’s single cutters block, not the number of cutter solids in the document - the model holds one block that drives the whole run.
On top of these the handle carries the shared Id, ObjectType ("MicroSetting"), MotherGemId (always empty here), LayerName, Position, plus Move() and Delete().
Queries
All(), Find(id), Count(), Selected(), ByLayer(name).
These resolve micro-setting custom objects in the active document and return IMicroSetting handles for them.