pcb_create_via
Create a PCB via at given X/Y coordinates with net, hole, and pad dimensions. Regenerate internal planes afterward to clear plane-zone-to-via DRC errors.
Instructions
Create a via at the specified position. Warning (upstream EDA bug, pro-api-sdk issue #32): if an internal plane (PLANE layer) has already been generated, a via on a different net created afterwards does NOT get its anti-pad cut. Rebuilding pours does not fix it; DRC reports "Plane Zone to Via". Regenerate the internal plane after placing vias. This is a fabrication risk, so do not ship until that DRC error is clear. 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 |
|---|---|---|---|
| x | Yes | X coordinate | |
| y | Yes | Y coordinate | |
| net | Yes | Net name | |
| viaType | No | Via type: "through" (0, default), "blind" (1, blind/buried) or "suture" (2, stitching), or the number. Names are converted to the numeric value EasyEDA requires. | |
| diameter | Yes | Via pad diameter | |
| 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. | |
| holeDiameter | Yes | Hole diameter |