This macro provides the dialog which allows you to execute your Python macros easily.
Put the macros.py file in the plugin directory let the file is automatically loaded.
KICAD_PATH/scripting/plugins
This macro provides way to add keepout area in polygon of approximate circle on your PCB in KiCAD pcbnew.
If you want to add circle has 3 mm radius at X, Y = 90, 100 position, call insert_keepout function as follows:
insert_keepout(90, 100, 3)
This macro provides way to set text properties on your PCBnew board. You can choose targets by regular expression of the module reference or text string.
Here is the function definition.
def set_text_properties(board, pattern, type="reference", width=None, height=None, thickness=None, visibility=None):
""" Sets text properties which matches with the pattern.
@param board Pcbnew board
This macro works on Python Shell provided by KiCAD 4.1 or later. 4.0.X can not be supported.
Python Shell is pretty good to execute your line of code provided by Pcbnew. But it is hard to execute long macro many times in the interactive mode. This macro provides way to execute your macros from files stored on your specified directory.
Prepare macros in selected directory and specify it in _KIMACROS
variable on Preferences - Configure Paths dialog.
Copy content of pyshell_hack.py file into your PyShell_pcbnew_startup.py
file which can be found through
Converts outline file between hierarchical text and OPML. This python script works with only Python3.
Here is list of options can be specified.
python3 olconv.py -h
usage: olconv [-h] [--version] [--char CHAR] [-f F] [-o O] [-i {hier,opml}]
[-x {hier,opml}] [--title TITLE] [--text TEXT]
// Compile as follows: | |
// g++ logger.cc -lbe -o logger | |
#include <Application.h> | |
#include <iostream> | |
#include <string.h> | |
#define LOGGER "application/x-vnd.Logger" | |
enum { |
import argparse | |
class Catkeys: | |
def __init__(self, path): | |
self.path = path | |
with open(path, "r") as f: | |
lines = f.readlines() | |
if not lines: | |
raise Exception('no data: ' + path) | |
data = {} |
If you think official footprint modules have small text size or thin lines for drawings, you can change them with this script at once.
You need https://github.com/adamgreig/agg-kicad/blob/master/scripts/sexp.py file to execute this script. Obtain it and put it into the same directory with the customize_mods.py file.
Here is list of options can be specified.
name = HHKB | |
# Place in /boot/home/config/non-packaged/data/KeyboardLayouts | |
# Size shortcuts | |
default-size = 10,10 | |
$b = 5,10 | |
$c = 18,10 | |
$d = 15,10 | |
$enter = d22,10 |
name = HHKB JP | |
# Place in /boot/home/config/non-packaged/data/KeyboardLayouts | |
# Size shortcuts | |
default-size = 10,10 | |
$b = 5,10 | |
$c = 20,10 | |
$d = 15,10 | |
$e = l15,20,11 |