How can I script to add through-hole pads to a custom footprint in KiCad?
Adding through-hole pads to a custom footprint in KiCad can be scripted using Python. The script snippet provided illustrates creating a new footprint and then adding a through-hole pad to it, specifying details like pad size, shape, drill size, and associated net:

```python
import pcbnew

# Script for adding through-hole pads to a custom footprint
board = pcbnew.GetBoard()
module = pcbnew.FOOTPRINT(board)
module.SetPosition(pcbnew.wxPointMM(x, y))
board.Add(module)

# Create and set up a through-hole pad
pcb_pad = pcbnew.PAD(module)
# ... (configure pad settings)
module.Add(pcb_pad)
```

This approach is effective for designing custom footprints with specific through-hole pad requirements, essential in many PCB designs for component mounting and connectivity.