lib_delete_footprint_primitives
Delete primitives from one PCB library footprint, scoped by library path, footprint name, and object type or layer so edits never hit an unnamed board. Pads stay protected unless explicitly included.
Instructions
Delete primitives inside ONE footprint of a PCB library.
THE ONLY LIBRARY-SCOPED PRIMITIVE DELETE. obj_delete and
pcb_delete_object both resolve a BOARD, and when no board is
focused that lookup opens the first PcbDoc any open project
holds. Aimed at a library they do not fail; they remove
primitives from a board you never named, and the reply does not
say which one. This is the tool for editing a footprint.
SCOPED THREE WAYS, all of which must agree before anything is removed: the library by path, the footprint by name, and the object type or layer. The library is verified AFTER it is brought to the front, so a delete aimed at one that never focused is refused rather than landing in whichever did.
PADS ARE EXCLUDED unless include_pads. Deleting a pad changes
the part's connectivity rather than its drawing, and clearing
graphics off a layer should not quietly cost you the pinout.
THE FOOTPRINT ON SCREEN IS EDITED FROM ANOTHER. The footprint the
editor shows keeps its primitives on the library board, which is
written back into it at the next switch, so removing from it in
place came undone. When the target is on screen, another
footprint is made current for the delete (a temporary one in a
single-footprint library, removed afterwards) and the target is
shown again at the end; was_current says this happened.
Args:
footprint_name: The footprint to edit. Required: deleting
from whichever footprint the editor happens to show is
the mistake this avoids.
object_type: PCB object type, e.g. "track", "arc", "text",
"region", "fill". Give this or layer.
layer: Restrict to one layer, e.g. "TopOverlay", or a name
the library's stack gives it, such as "Top Assembly". A
name the stack does not have is refused, with the names
it does have.
library_path: The .PcbLib. Defaults to the focused document.
include_pads: Allow pads to be removed. Off by default.
confirm: Required. Read the footprint first with
lib_probe_footprint and pass True once the filters
are what you mean.
Returns:
Dict with library, footprint, removed,
examined, layers, pads_included and
was_current.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | ||
| confirm | No | ||
| object_type | No | ||
| include_pads | No | ||
| library_path | No | ||
| footprint_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||