pcb_get_primitives_in_region
Fetch PCB primitives inside a rectangular region defined by left, right, top, and bottom mil coordinates, with options for containment, field projection, and result limits.
Instructions
Get all primitives within a rectangular region on the PCB. Coordinates are PCB canvas coordinates in mil (1 mil = 0.001 inch), relative to the canvas origin: +X = rightward, +Y = upward. Lengths (widths, diameters) are also in mil. Use pcb_canvas_origin to read/set the origin offset and pcb_convert_coordinates to convert between canvas and data coordinates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | Yes | Top boundary Y | |
| left | Yes | Left boundary X | |
| limit | No | Truncate result array to at most N items | |
| right | Yes | Right boundary X | |
| bottom | Yes | Bottom boundary Y | |
| fields | No | Project results to only these top-level keys. Response includes _availableFields showing all keys. IMPORTANT: Always specify fields when you know what you need — without it, responses include every property and can be extremely large (100KB+), wasting context. | |
| filter | No | Keep items matching all conditions (AND). Exact: {key: value}, prefix glob: {key: "R*"}, OR: {key: ["a","b"]} | |
| document | Yes | Target document UUID — auto-switches to this document before executing. Get UUIDs from list_instances or editor_get_open_tabs. | |
| instance_id | No | Target EasyEDA instance ID (8-char hex). Required when multiple instances are connected. Omit when only one instance is connected (auto-selected). Use list_instances to see connected instances. | |
| leftToRight | No | true=must be fully inside, false=intersecting also counts |