← Back to team overview

kicad-developers team mailing list archive

Re: Kicad scripting progress :-)

 

We can read and write libraries now with the latest extensions to PLUGIN
that Dick & Wayne did :)
now it always use legacy, but they will work with all formats. :-)

from pcbnew import *
lst = FootprintEnumerate("/usr/share/kicad/modules/sockets.mod")
for name in lst:
m = FootprintLoad("/usr/share/kicad/modules/sockets.mod",name)
print name,"->",m.GetLibRef(), m.GetReference()
for p in m.GetPads():
print "\t",p.GetPadName(),p.GetPosition(), p.GetOffset()
-------------------------------------------

20TEX-ELL300 -> 20TEX-ELL300 U***
1 (19500, 57000) (0, 0)
2 (20500, 57000) (0, 0)
3 (21500, 57000) (0, 0)
4 (22500, 57000) (0, 0)
5 (23500, 57000) (0, 0)
6 (24500, 57000) (0, 0)
7 (25500, 57000) (0, 0)
8 (26500, 57000) (0, 0)
9 (27500, 57000) (0, 0)
10 (28500, 57000) (0, 0)
11 (28500, 54000) (0, 0)
12 (27500, 54000) (0, 0)
13 (26500, 54000) (0, 0)
14 (25500, 54000) (0, 0)
15 (24500, 54000) (0, 0)
16 (23500, 54000) (0, 0)
17 (22500, 54000) (0, 0)
18 (21500, 54000) (0, 0)
19 (20500, 54000) (0, 0)
20 (19500, 54000) (0, 0)
HOLE (18500, 51500) (0, 0)
HOLE (27500, 59500) (0, 0)
20TEX300 -> 20TEX300 U***
1 (19500, 57000) (0, 0)
2 (20500, 57000) (0, 0)
3 (21500, 57000) (0, 0)
4 (22500, 57000) (0, 0)
5 (23500, 57000) (0, 0)
6 (24500, 57000) (0, 0)
7 (25500, 57000) (0, 0)
8 (26500, 57000) (0, 0)
9 (27500, 57000) (0, 0)
10 (28500, 57000) (0, 0)
11 (28500, 54000) (0, 0)
12 (27500, 54000) (0, 0)
13 (26500, 54000) (0, 0)
14 (25500, 54000) (0, 0)
15 (24500, 54000) (0, 0)
16 (23500, 54000) (0, 0)
17 (22500, 54000) (0, 0)
18 (21500, 54000) (0, 0)
19 (20500, 54000) (0, 0)
20 (19500, 54000) (0, 0)
HOLE (18500, 51500) (0, 0)
...
...
...


-- 

Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 636 52 25 69
skype: ajoajoajo

Follow ups

References