Skip to content

Scripting API

Named pendant

from ArtisanPlugin.Scripting import NamedPendantApi

A name pendant is a word cut in metal and worn as a pendant: the letters are extruded to a thickness and joined to each other - and, on a script font, to the connecting plate or rail that keeps loose letters from falling apart. The tool takes the text and a font, builds the letter solids on the plane you give it, and bakes them as an editable smart component so the name can be changed afterwards from the panel.

Create

ids = NamedPendantApi.Create(text, plane = ..., height = 5, thickness = 0.4,
                             font = None)                              # -> [ids]
ParameterDefaultMeaning
textrequiredThe name to write - empty or whitespace throws
planeomitted or invalid -> the active view’s construction planeThe plane the name is written on
height0 -> tool default 5Cap height of the letters, mm
thickness0 -> tool default 0.4Extrusion depth of the letters, mm
fontNone -> tool default Arial boldName of an installed font

text is the only required argument; a null, empty or whitespace string throws ArgumentException before anything is computed. The numeric parameters follow the house 0-keeps-default convention, and font keeps the default when it is null or whitespace. Defaults come from the same NamedPendant model the ArtisanNamedPendant command uses, overwritten by the user’s saved named-pendant defaults when they have any.

An omitted or invalid plane falls back to the construction plane of the active viewport, and to world XY when there is no active view.

Create returns a list of Guids - one per baked brep, so letters plus any plate or rail the font requires - not a single id. There is no handle and no query methods on this facade; if you need to reach the result again, keep the returned ids.

The parts are baked as editable brep custom objects, given the document’s metal material and put into one Rhino group named Named Pendant <guid>. The parameters are serialised onto that group as smart-component user data, which is what lets the panel re-open and re-edit the name later. Note that, unlike the other accessories, the parts keep the document’s current layer rather than being moved to the metal layer - only the material is applied.

Create throws InvalidOperationException when the name fails to compute, which in practice means an unusable text or a font name that is not installed. Being a licensed mutation, it is worth wrapping in a Transaction so the whole pendant - group and all its parts - undoes in one step.