inspect_drawing
Inspects 2D drawings to return bounding boxes, face/edge counts, annotation metadata, and structural lint. Supports session mode for annotated objects or SVG mode for analyzing SVG files.
Instructions
Structured bbox and annotation report for a 2D drawing.
Two modes:
1. Session mode (default): inspects objects registered via annotate()/show().
Returns per-object bounding boxes, face/edge counts, annotation metadata
(label string, measured length, leader tip/elbow), and structural lint.
2. SVG mode (svg_path set): parses an SVG file from disk and reports page
size, layer ids, text content + positions, and element counts. Decouples
inspection from the build-and-register ceremony — works on SVGs from any
source (CI artifacts, third-party exports, prior runs).
Use annotate(result, name) instead of show(result.shape, name) when building
with build123d_drafting so metadata is captured:
from build123d_drafting import dim_linear, Draft
draft = Draft(font_size=2.5, decimal_precision=1)
w = dim_linear((-20, -10, 0), (20, -10, 0), "below", 8, draft, label="40")
annotate(w, "width_dim")
For vanilla build123d.ExtensionLine/DimensionLine, pass the label explicitly:
w = ExtensionLine(border=[...], offset=6, draft=draft, label="40")
annotate(w, "width_dim", label="40")
Args:
objects: comma-separated object names (default: all). Session mode only.
svg_path: path to an SVG file on disk. Switches to SVG mode.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| objects | No | ||
| svg_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |