Can I use Python to place vias at specific locations relative to component pads in KiCad?
Yes, you can use Python to place vias at specific locations relative to component pads in KiCad. The script provided shows how to position a via a certain distance from a pad:

```python
import pcbnew
from pcbnew import wxPoint, wxPointMM

board = pcbnew.GetBoard()
pad = board.FindFootprintByReference('R2').FindPadByNumber('2').GetCenter()
via_location = wxPoint(pad.x + 1 * pcbnew.IU_PER_MM, pad.y)
add_track(pad, via_location)
via = pcbnew.PCB_VIA(board)
via.SetPosition(via_location)
via.SetDrill(int(0.4 * 1e6))
via.SetWidth(int(0.8 * 1e6))
board.Add(via)

pcbnew.Refresh()
```

This method is particularly helpful for precise via placement in PCB designs, enabling enhanced electrical connectivity and layout optimization.