Skip to content

Scripting API

Analysis

from ArtisanPlugin.Scripting import AnalyzeApi as analyze, WeightApi as weight

The measuring side of the API: wall-thickness probing and metal weights. Each has its own page.

Read-only by default

Analysis is the one corner of the API you can run freely on a document without changing it. Every method here is read-only unless you explicitly ask for the drawing:

PageMutates the document?
ThicknessOnly with annotate = True, which draws the measurement line, its text dot and end points
Global thicknessOnly with colorize = True, which adds the vertex-coloured mesh
WeightsNever
Weight by areaNever

The two opt-in drawing paths also trigger the licence check and belong inside a Transaction; the pure measurements need neither.

Two ways to weigh

The distinction matters and is easy to get wrong:

  • Weights computes the true volume of closed solids and multiplies by the metal density. This is the number you quote.
  • Weight by area multiplies surface area by a thickness you supply, as a sheet-metal estimate for open shells that have no volume to measure.

Conventions

Millimetres and grams throughout. Metal names come from WeightApi.Metals(); matching is case-insensitive and tolerates dashes and spaces.