lib_redraw_assembly
Redraw assembly drawings for selected PCB footprints from body, pad, or courtyard geometry, replacing misplaced or missing layer content and adding designator text.
Instructions
Draw the assembly layer of the focused PCB library again from
each footprint's own geometry: a rectangle round the part and a
.Designator in its middle.
Libraries collected over the years carry the assembly drawing on
the wrong layer, from another package, or not at all. With
replace (the default) each footprint's tracks, arcs, texts,
fills and regions on layer are cleared first; 3D bodies and
pads on that layer are never touched.
Args:
layer: The mechanical layer the assembly drawing goes on.
footprint_names: Only these footprints. Empty means all.
outline_from: What the rectangle goes round. body (the 3D
bodies), pads (their copper, without mask expansion),
courtyard (whatever is drawn on courtyard_layer),
or auto (bodies, then the courtyard when
courtyard_layer is given, then pads). A footprint
with none of them is skipped and named in skipped.
courtyard_layer: The layer the courtyard is drawn on. It
cannot be layer itself with replace, which would
clear the courtyard.
width: Line width. Default 4 mil (0.1 mm).
designator: Place a .Designator text in the middle,
turned upright in a box taller than wide.
text_height: Text height. 0 sizes it to a third of the
box's short side, kept short enough for a four-character
designator to fit along the long side, between 0.2 and
1 mm.
replace: Clear what is on the layer first. With False the new
drawing goes beside what is there.
confirm: Required with replace, since it clears that
layer in every footprint it redraws.
units: "mil" (default) or "mm" for width and
text_height.
The footprint on screen is shown again at the end. Does NOT save
the library. A mechanical layer the library has not enabled is
accepted, with layer_enabled false and a warning, since
Altium does not draw what is on it.
Returns:
Dict with layer, layer_enabled, redrawn,
cleared, skipped,
not_found, and items ({name, outline_from, cleared, width_mm, height_mm} per footprint drawn).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | Yes | ||
| units | No | mil | |
| width | No | ||
| confirm | No | ||
| replace | No | ||
| designator | No | ||
| text_height | No | ||
| outline_from | No | auto | |
| courtyard_layer | No | ||
| footprint_names | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||