summaryrefslogtreecommitdiff
path: root/pcbnew/scripting/examples/listPcbLibrary.py
diff options
context:
space:
mode:
Diffstat (limited to 'pcbnew/scripting/examples/listPcbLibrary.py')
-rwxr-xr-xpcbnew/scripting/examples/listPcbLibrary.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pcbnew/scripting/examples/listPcbLibrary.py b/pcbnew/scripting/examples/listPcbLibrary.py
new file mode 100755
index 0000000..8262c17
--- /dev/null
+++ b/pcbnew/scripting/examples/listPcbLibrary.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+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.Pads():
+ print "\t",p.GetPadName(),p.GetPosition(),p.GetPos0(), p.GetOffset()
+