pcb_delete_object
Deletes the nearest PCB object within 100 mils of specified X/Y coordinates on a layer, with optional object-type filtering for precise board cleanup.
Instructions
Delete a PCB object closest to specific coordinates on a layer.
Finds the nearest matching object within 100 mils of the given coordinates and removes it from the board. Distance is to the object itself: a track by its segment less half its width, an arc by its curve, a via by its centre less its radius, anything else by its bounding rectangle (0 inside it). A point anywhere on a track finds that track.
Args:
x: Target X position in mils
y: Target Y position in mils
layer: PCB layer name (default "TopLayer")
object_type: Type of object to delete. Options:
"track" - Track segment
"via" - Via
"fill" - Copper fill
"text" - Text string
"pad" - Free pad
"arc" - Arc
"polygon" - Copper polygon pour
"region" - Region / split-plane
"component" - Placed component
(for bulk/filter-based deletes use obj_delete)
Returns: Dictionary with deleted status, object_type, distance_mils, the deleted object's net and bbox_mils, and others_as_close: how many other objects were exactly as near, so a pick among equals is visible.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| layer | No | TopLayer | |
| object_type | No | track |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||