How To Write Python Scripts In KiCAD
warning
This page is in notes format, and may not be of the same quality as other pages on this site.
Overview
PCB Scripting
The library pcbnew
will be automatically available to you when running the script within pcbnew
, all you need to do is to import
it:
import pcbnew
board = pcbnew.GetBoard()
![](/assets/images/kicad-pcbnew-python-shell-pyalamode-a86ef35a3b50813c241e508ffa99d738.png)
Scripts are placed in <kicad installation dir>/scripting/plugins/
. They then show up in pcbnew
under Tools > External Plugins.
![](/assets/images/kicad-default-provided-python-plugins-135e40cec737af6ed8fe275a1c32298a.png)