Renaming diodes and scripting their position relative to their key
This commit is contained in:
parent
f436fdf243
commit
19598de988
3 changed files with 13395 additions and 12233 deletions
18
keyboard_pcb/diodes_positionning.py
Normal file
18
keyboard_pcb/diodes_positionning.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
|
||||
import pcbnew
|
||||
board = pcbnew.GetBoard()
|
||||
mods = board.GetModules()
|
||||
|
||||
for i in mods:
|
||||
ref = i.GetReference()
|
||||
if not ref.startswith('D'):
|
||||
continue
|
||||
k_ref = "K" + ref[1:]
|
||||
k = board.FindModuleByReference(k_ref)
|
||||
print k_ref, k
|
||||
k_center = k.GetCenter()
|
||||
d_center = pcbnew.wxPoint(k_center.x - 3808700, k_center.y - 6200000)
|
||||
i.SetPosition(d_center)
|
||||
i.SetOrientation(2700)
|
||||
print k_ref, ref, d_center
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue