Skip to content

Scripting API

Accessories

Every smart component in Artisan’s Components family can be created from a script. Each facade mirrors its panel’s Accept button exactly — same custom object type, same destination layer, same metal material — and the result is the same editable component the panel inserts. Each has its own page.

What each one starts from

The first thing to know about a component is what you have to give it. That decides whether you can build it out of nothing or whether something must already exist in the document.

Starts fromComponents
A plane — free-standing, built out of nothingBail, Bangle, Bead, Charm, Link, Named pendant, Huggie, Engraving
A curveMilgrain, Rope, Voronoi, Honeycomb, Chain
A surfaceTexture 3D
An existing solid or objectHinge, Pattern, Profile sweep, User element

In the free-standing components, an omitted or invalid plane uses the active view’s construction plane.

Conventions

The 0-keeps-default convention: every numeric parameter accepts 0 to mean “use the tool’s default (or my saved defaults)”. The exceptions are the parameters where 0 is itself meaningful — Link’s twistAngle, Hinge’s openingAngle, Huggie’s aperturePercentage, Pattern’s reverseMode and Profile sweep’s continuities — which use -1 instead.

profile does not mean the same thing everywhere: Bail and Bangle take a RING_PROFILE asset name, Charm takes a CHARM_PROFILE one, and Bead takes a fixed "SQUARE" / "ROUND" vocabulary rather than an asset at all.

What comes back

Unlike the gemsets and shanks, these facades hand back plain object ids, not parametric handles — there is no All(), no Find(id) and no setter to re-edit the component afterwards. Re-open it in its panel to change it, or delete and rebuild. The one exception is UserElementApi.List(), which names the elements in the document.

  • All of these are licensed mutations — wrap them in a Transaction for one-step undo.
  • Passing an id that isn’t the expected kind fails with a clear message (“Object … is not a curve.”), and a computation that can’t succeed with the given inputs raises ”… computation failed” naming the tool.

Where the results land

Most components route their geometry to the metal layer with the document’s metal material, exactly like the panel’s Accept — but not all of them, and the difference matters if you are building a pipeline that expects everything on one layer.

Lands onComponents
Metal layer, metal material — the normBangle, Bead, Charm, Link, Milgrain, Rope, Huggie, Texture 3D, Engraving (its solid text; the curves go to the user layer)
Metal material, but the current layerBail, Named pendant
The source object’s attributes — layer, colour and material inheritedHinge, Chain
Default attributes — no layer routing, no materialPattern, Profile sweep
MixedVoronoi, Honeycomb — only some result shapes become editable components with the metal material; Honeycomb’s lattice curves land on the secondary object layer with default attributes