Import the kicad site-packages into the python environment you are using.
import sys
sys.path.insert(0, "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/")
import pcbnew
Kicad includes it own version of Python anycodings_kicad (Version 2.7.13 at time of writing for anycodings_kicad Kicad 5.1 but moving to python 3 anycodings_kicad shortly). You can access Kicad python anycodings_kicad via the Pcbnew python terminal Tools anycodings_kicad > Scripting console.,Import the kicad site-packages into the anycodings_kicad python environment you are using., Import the kicad site-packages into the anycodings_kicad python environment you are using. import sys sys.path.insert(0,"/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/") import pcbnew ,Run it using the inbuilt python 2.7 using either the scripting console or specifying the Kicad python version in the shebang line (you will have to search for this but, in macOS, for instance it is found in /Applications/Kicad/kicad.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python)
Import the kicad site-packages into the anycodings_kicad python environment you are using.
import sys
sys.path.insert(0, "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/")
import pcbnew
For more information about creating new footprint wizards, see the Scripting section of the Advanced Topics chapter.,Test for parity between PCB and schematic: when enabled, the design rule checker will test for differences between the schematic and PCB in addition to testing the PCB design rules. This option has no effect when running the PCB editor in standalone mode.,The tool adds the footprint for each symbol to the board and transfers updated schematic information to the board. In particular, the board’s net connections are updated to match the schematic.,Center view on cross-probed items: When both Eeschema and Pcbnew are running, controls whether clicking a component or pin in Eeschema will center the Pcbnew view on the corresponding footprint or pad.
(version 1)
(rule <name>
[(layer <layer_name>)]
[(condition <expression>)]
(constraint <constraint_type> [constraint_arguments]))
# Clearance for 400 V nets to anything else (rule HV(condition "A.NetClass == 'HV'") (constraint clearance(min 1.5 mm)))
# Do not allow footprints on back layer(no condition clause means this rule always applies) (rule "Top side footprints only" (layer B.Cu) (constraint disallow footprint)) # This rule does the same thing, but is less efficient (rule "Top side footprints only" (condition "A.Layer == 'B.Cu'") (constraint disallow footprint)) # Larger clearance on outer layers(inner layer clearance set by board minimum clearance) (rule "clearance_outer" (layer outer) (constraint clearance(min 0.25 mm)))
(rule RF_width(layer outer) (condition "A.NetClass == 'RF'") (constraint track_width(min 0.35 mm)(max 0.35 mm))) (rule "BGA neckdown" (constraint track_width(min 0.2 mm)(opt 0.25 mm)) (constraint clearance(min 0.05 mm)(opt 0.08 mm)) (condition "A.insideCourtyard('U3')")) (rule "Distance between Vias of Different Nets" (constraint hole_to_hole(min 0.25 mm)) (condition "A.Type =='Via' && B.Type =='Via' && A.Net != B.Net")) (rule "Distance between test points" (constraint courtyard_clearance(min 1.5 mm)) (condition "A.Reference =='TP*' && B.Reference == 'TP*")) # This assumes that there is a cutout with 1 mm thick lines (rule "Clearance to cutout" (constraint clearance(min 0.8 mm)) (condition "A.Layer=='Edge.Cuts' && A.Thickness == 1.0mm")) (rule "Max Drill Hole Size Mechanical" (constraint hole(max 6.3 mm)) (condition "A.Pad_Type == 'NPTH, mechanical'")) (rule "Max Drill Hole Size PTH" (constraint hole(max 6.35 mm)) (condition "A.Pad_Type == 'Through-hole'")) # Specify an optimal gap for a particular differential pair (rule "Clock gap" (condition "A.inDiffPair('/CLK')") (constraint diff_pair_gap(opt 0.8 mm))) # Specify a larger clearance between differential pairs and anything else (rule "Differential pair clearance" (condition "A.inDiffPair('*') && !AB.isCoupledDiffPair()") (constraint clearance(min 1.5 mm)))