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, Engraving
A curveMilgrain, Rope, Voronoi, Honeycomb, Chain, Smart profile
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, 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, most of these facades return plain object ids, not parametric handles. To edit a component after creating it, pass one of those ids to SmartComponentApi.Find:

  • Editable by path: Bail, Named pendant, Bangle, Bead, Charm, Link, Milgrain, Rope, Texture 3D and Engraving. SetParameter("top_profile.width", …) regenerates the component in place, and SetElement(name) applies a saved preset where that component has one.
  • Typed handle: Smart profile returns ISmartProfile handles directly.
  • Not editable from scripts: Voronoi, Honeycomb, Hinge, Chain, Pattern, Profile sweep and User element. Re-open them in their panel, or delete and rebuild. UserElementApi.List() still names the user elements in the document.

Bail, Bangle, Bead, Charm, Named pendant and Smart profile can also start from a saved element with element=.

  • 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 normBail, Bangle, Bead, Charm, Link, Milgrain, Rope, Texture 3D, Engraving (its solid text; the curves go to the user layer)
Metal material, but the current layerNamed 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