example for pcb creation in scripting

This commit is contained in:
Miguel Angel Ajo 2012-04-06 21:48:00 +02:00
parent 96c1a50e00
commit b54acf607a
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
from pcbnew import *
import pcbnew
pcb = BOARD()
module = MODULE(pcb)
module.SetReference("M1")
pad = D_PAD(module)
module.m_Pads.PushBack(pad)
pad.thisown=0
pcb.Add(module)
pcb.Save("/tmp/my2.brd")
print map( lambda x: x.GetReference() , list(pcb.GetModules()))
print "Saved?"