From c481702b70703bc417b3b977b2824c6abc6b7cad Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 22 Mar 2011 04:06:18 -0300 Subject: [PATCH] hacks/brdclw: change (silk screen) line width in a component --- hacks/brdclw | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 hacks/brdclw diff --git a/hacks/brdclw b/hacks/brdclw new file mode 100755 index 0000000..b1f78d9 --- /dev/null +++ b/hacks/brdclw @@ -0,0 +1,29 @@ +#!/usr/bin/perl +# +# brdclw - Change line width in a specific module in a KiCAD .brd file +# + +sub usage +{ + print STDERR "usage: $0 module from to in-file\n"; + exit(1); +} + +&usage unless @ARGV == 4; + +$mod = shift(@ARGV); +$from = shift(@ARGV); +$to = shift(@ARGV); + +while (<>) { + $this = $1 eq $mod if /^\$MODULE\s+(\S+)/; + $this = 0 if /^\$EndMODULE/; + if ($this && /^DS\s/) { + @ds = split(/\s+/); + if ($ds[5] == $from) { + $ds[5] = $to; + $_ = join(" ", @ds)."\n"; + } + } + print || die; +}