Created
May 18, 2017 11:44
-
-
Save idt12312/94b4bdadf3b531abe991004d60977c8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kicad_tools | |
#抵抗とLEDを正規表現を使って検索し、リストにする | |
rList = kicad_tools.findModulesByRe("R\d+") | |
ledList = kicad_tools.findModulesByRe("D\d+") | |
#LEDを(100mm,100mm)を始点に(10mm,0)間隔で直線上に並べる | |
kicad_tools.arrangeInLine(ledList, (100,100), (10,0)) | |
#抵抗を(100mm,150mm)を始点に3x4行列のように並べる | |
#順番はR1 R2 R3 R4 | |
# R5 R6 R7 R8.....みたいな感じで | |
#間隔は(20mm,10mm) | |
kicad_tools.arrangeInMatrix(rList, (100,120), (20,10), 4, kicad_tools.HORIZON_THEN_VERTICAL) | |
#抵抗それぞれの向きを90度にする | |
kicad_tools.rotate(rList, 90) | |
#抵抗のリファレンスのシルクのサイズを大きく(3),太く(0.4)する | |
kicad_tools.changeRefSize(rList, 3, 0.4) | |
#(100mm,100mm)を中心にLEDは半径50mm,抵抗は半径30mmに並べる | |
kicad_tools.arrangeInCircle(ledList, (100,100), 50) | |
kicad_tools.arrangeInCircle(rList, (100,100), 30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment