Entry points¶
Build a drawing¶
build_drawing(step_file, out=None, title=None, number='DWG-001', tolerance='ISO 2768-m', drawn_by='', scale=None, page=None, auto_dims=True, detail_view=True, pmi=None, repair=True, assembly=None, model=None, decorations=None, requested=None, authored=None, trace=None, material='', date='', revision='A', company='', frame=False, projection=None, zones=False)
¶
Build a customisable 4-view :class:Drawing without exporting it.
Same arguments as :func:make_drawing, but returns the live :class:Drawing
so you can add or remove annotations and add section/auxiliary views before
calling :meth:Drawing.export. make_drawing(...) is
build_drawing(...).export(formats=("svg", "dxf")), unpacked to a tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auto_dims
|
bool
|
pass |
True
|
detail_view
|
bool
|
automatically recover crowded prismatic step dimensions in an
enlarged detail view. Default |
True
|
pmi
|
Literal['off', 'report', 'annotate'] | None
|
AP242 PMI handling. |
None
|
repair
|
bool
|
run the bounded lint→repair loop (:meth: |
True
|
assembly
|
bool | None
|
severity of the feature-coverage lint for a general-arrangement
drawing. |
None
|
model
|
Sequence[Feature] | PartModel | None
|
a caller-supplied IR (ADR 0011) — a :class: |
None
|
trace
|
str | Path | bool | None
|
the opt-in solve-trace / explain mode (#736): record every strip
placement decision as ONE JSON file per build (schema
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Drawing
|
class: |
Drawing
|
and the automatic dimensions + title block already added. |
Build and export in one call¶
make_drawing(step_file, out=None, title=None, number='DWG-001', tolerance='ISO 2768-m', drawn_by='', scale=None, page=None, auto_dims=True, detail_view=True, pmi=None, assembly=None, material='', date='', revision='A', company='', frame=False, projection=None, zones=False)
¶
Generate a 4-view technical drawing from a STEP file or build123d object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step_file
|
str | Path | Shape
|
Path to a STEP/STP file, or a build123d |
required |
out
|
str | None
|
Output path stem (default: input filename stem, or |
None
|
title
|
str | None
|
Part title for the title block (default: stem uppercased). |
None
|
number
|
str
|
Drawing number (e.g. |
'DWG-001'
|
tolerance
|
str
|
General tolerance string (e.g. |
'ISO 2768-m'
|
drawn_by
|
str
|
Designer name for the title block. |
''
|
scale
|
float | None
|
Drawing-scale override (e.g. |
None
|
page
|
str | tuple | None
|
Page-size override — an ISO name ( |
None
|
auto_dims
|
bool
|
pass |
True
|
detail_view
|
bool
|
automatically add an enlarged view for crowded prismatic step
dimensions. Default |
True
|
Returns:
| Type | Description |
|---|---|
tuple[str, str]
|
Tuple of |
This is a thin wrapper: make_drawing(...) is
build_drawing(...).export(formats=("svg", "dxf")), unpacked to a tuple. Not a bare
.export() — that is the deprecated legacy shape and warns (#987).
To add or remove annotations or add section/auxiliary views before export,
call :func:build_drawing and use the returned :class:Drawing.