lib_set_pad_properties
Modify existing PcbLib footprint pads by setting copper size, shape, rotation, hole, plating, paste and mask expansions; only supplied fields change and results are read back.
Instructions
Change pads that already exist in a PcbLib footprint.
Every pad named pad_name in the footprint is changed, and
only the fields you pass are written, so setting plating leaves
the shape alone. Each pad is read back afterwards and the reply
reports what it holds, not what was asked.
A mask or paste expansion is written with the pad's manual flag
set: without it Altium ignores the value and follows the board's
rule, and a library has no rules. hole_width makes the hole a
slot; hole_rotation is relative to the pad, so a slot lines up
when its long axis matches the copper's in the pad's frame (see
slot_aligned in lib_get_pad_geometry). On a pad with a
per-layer stack only the top size is written, and note says so.
THE MASK HAS TWO SIDES. A pad keeps a top and a bottom solder
mask expansion; with the sides linked the top value serves both,
but the bottom value is still stored and takes effect the moment
the sides are unlinked. So mask_expansion writes both sides
unless mask_bottom_expansion is given too, which writes the
bottom and unlinks the sides. mask_separate links or unlinks
them explicitly. The reply reads back all three.
Args:
footprint_name: The footprint holding the pad.
pad_name: The pad's designator.
library_path: Optional .PcbLib path; defaults to the focused
library.
units: "mil" (default) or "mm", for every length here.
x_size, y_size: Copper size.
shape: "round", "rectangular" or "octagonal".
rotation: Pad rotation in degrees.
hole_size: Hole diameter, 0 for a surface-mount pad.
hole_width: Slot length; makes the hole a slot.
hole_rotation: Slot rotation relative to the pad, in degrees.
plated: Whether the hole is plated.
paste_expansion, mask_expansion: Expansions, set as manual.
mask_expansion is the top side, and the bottom too
unless mask_bottom_expansion is given.
mask_bottom_expansion: The bottom side's mask expansion; the
sides are unlinked.
mask_separate: Link (False) or unlink (True) the two sides.
Returns:
pads_changed, pads_with_a_failed_write, note and
pads, each as read back (position, size, rotation, hole,
slot, plating, expansion states, mask_expansion_mm,
mask_bottom_expansion_mm, mask_separate,
all_writes_ran).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shape | No | ||
| units | No | mil | |
| plated | No | ||
| x_size | No | ||
| y_size | No | ||
| pad_name | Yes | ||
| rotation | No | ||
| hole_size | No | ||
| hole_width | No | ||
| library_path | No | ||
| hole_rotation | No | ||
| mask_separate | No | ||
| footprint_name | Yes | ||
| mask_expansion | No | ||
| paste_expansion | No | ||
| mask_bottom_expansion | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||