Scripting API
Bead
from ArtisanPlugin.Scripting import BeadApi
A bead is the small pierced body strung onto a chain, cord or bracelet. Artisan builds it from its overall width and height with a stringing hole bored straight through, in either a square-sectioned or a round-sectioned form.
Create
id = BeadApi.Create(plane = ..., width = 10, height = 10, holeDiameter = 3,
profile = None) # -> id
| Parameter | Default | Meaning |
|---|---|---|
plane | active CPlane | Placement plane; omitted or invalid falls back to the active view’s construction plane, then to Plane.WorldXY |
width | 10 | Overall width, mm |
height | 10 | Overall height, mm |
holeDiameter | 3 | Diameter of the stringing hole, mm |
profile | "SQUARE" | "SQUARE" or "ROUND" |
The three numbers follow the 0-keeps-default convention: 0 means “use the tool’s default, or my saved defaults”. No -1 sentinel is needed on this facade.
Create returns the single Guid of the bead - a parametric Bead custom object, added to the metal layer with the document’s metal material, exactly like the panel’s Accept.
Defaults resolve slightly differently from Bail, Bangle and Charm: because profile is not an asset here, your saved bead defaults are always applied first, whether or not you pass a profile, and your explicit arguments then override them. There is no skip-my-defaults trap on this page.
This is a licensed mutation and needs an active document. If the bead cannot be built with the given numbers it raises “Bead computation failed with the given parameters.” Wrap the call in a Transaction for one-step undo.