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.
ThicknessWall thickness at one point, or many at once.
Global thicknessThe whole-piece wall map: stats, thin spots, optional colorized mesh.
WeightsPer-metal grams for the document, ids or the selection.
Weight by areaSheet-metal estimate for open shells: area × thickness.
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:
| Page | Mutates the document? |
|---|---|
| Thickness | Only with annotate = True, which draws the measurement line, its text dot and end points |
| Global thickness | Only with colorize = True, which adds the vertex-coloured mesh |
| Weights | Never |
| Weight by area | Never |
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.