EDA > KiCad

Extracting global and local labels from a schematic?


phil from seattle:
I need to extract global and local labels from a schematic. The end goal is some sort of script to produce a printable file with all of the labels.

I've looked at a number of ways to do it. Running a script on the .sch file directly is a real pita.  I can get pretty close with Orcad and cadstar netlists. Is there a better way?  This needs to work against 5.1.x for now.  Once 6.0 is released, I'll move up to that.

For those that are curious, I am using Kicad to do electrical cabinet design for CNC machines and want to print out a list of wire labels to be attached to both ends of all the interconnect wires. I know there are specific tools for electrical panels but want to use kicad as it dovetails with my other processes. 

phil from seattle:
For what it's worth, an awk script to create a CSV with the labels.

#  AWK script to filter out a list of labels (global and local) from a
#  CADStar net list exported from KiCad.
#   Produces a CSV file with 2 columns of the labels.
#   Strips out CR from the end of the netlist lines
#   and puts it back at the end of the output line.
#   Should work with any awk flavor but not tested.

BEGIN {print "Label,Label"}
if(match($1,".ADD_TER")) {
   sub("/.*/", "",$4)
   sub("\015", "", $4)
   print $4 "," $4 "\015"


[0] Message Index

There was an error while thanking
Go to full version