Is it possible to script the removal of all graphical elements from a PCB layout in KiCad?
Yes, it's possible to script the removal of all graphical elements from a PCB layout in KiCad using Python. The script provided efficiently deletes every drawing object, including lines, shapes, and text annotations:

```python
import pcbnew

board = pcbnew.GetBoard()
for dr in board.GetDrawings():
   board.Delete(dr)

pcbnew.Refresh()
```

This approach is especially useful for cleaning up the PCB layout, making it easier to start fresh with new design elements or to simplify the board for production.