summaryrefslogtreecommitdiff
path: root/pcbnew/scripting/examples/hidePcbValuesShowReferences.py
diff options
context:
space:
mode:
authorsaurabhb172020-02-26 16:00:53 +0530
committerGitHub2020-02-26 16:00:53 +0530
commit886d9cb772e81d2e5262284bc3082664f084337f (patch)
tree6acee185a4dc19113fcbf0f9a3d6941085dedaf7 /pcbnew/scripting/examples/hidePcbValuesShowReferences.py
parent0db48f6533517ecebfd9f0693f89deca28408b76 (diff)
parentaa35045840b78d3f48212db45da59a2e5c69b223 (diff)
downloadKiCad-eSim-886d9cb772e81d2e5262284bc3082664f084337f.tar.gz
KiCad-eSim-886d9cb772e81d2e5262284bc3082664f084337f.tar.bz2
KiCad-eSim-886d9cb772e81d2e5262284bc3082664f084337f.zip
Merge pull request #1 from saurabhb17/develop
Added main functions
Diffstat (limited to 'pcbnew/scripting/examples/hidePcbValuesShowReferences.py')
-rw-r--r--pcbnew/scripting/examples/hidePcbValuesShowReferences.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pcbnew/scripting/examples/hidePcbValuesShowReferences.py b/pcbnew/scripting/examples/hidePcbValuesShowReferences.py
new file mode 100644
index 0000000..6b37842
--- /dev/null
+++ b/pcbnew/scripting/examples/hidePcbValuesShowReferences.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+import sys
+from pcbnew import *
+
+filename=sys.argv[1]
+
+pcb = LoadBoard(filename)
+
+for module in pcb.GetModules():
+ print "* Module: %s"%module.GetReference()
+ module.Value().SetVisible(False) # set Value as Hidden
+ module.Reference().SetVisible(True) # set Reference as Visible
+
+pcb.Save("mod_"+filename)