1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
<TITLE>kicad help</TITLE>
<META NAME="GENERATOR" CONTENT="LibreOffice 4.0.2.2 (Windows)">
<META NAME="CREATED" CONTENT="0;0">
<META NAME="CHANGED" CONTENT="20130614;10225357">
<STYLE TYPE="text/css">
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto }
P.western { font-family: "Arial", sans-serif; font-size: 10pt; so-language: en-US }
A:link { color: #004586; text-decoration: none }
A.western:link { font-family: "Liberation Sans", sans-serif; so-language: zxx; font-style: italic }
A.sdfootnotesym-western { font-family: "DejaVu Serif", serif }
-->
</STYLE>
</HEAD>
<BODY LANG="en-AU" LINK="#004586" DIR="LTR">
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto"><A NAME="__RefHeading__2925_482973253"></A>
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>1 - Full
documentation:</B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN LANG="en-US"><B>The
</B></SPAN></FONT></FONT><FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN LANG="en-US"><I><B>Eeschema
documentation, chapter 14</B></I></SPAN></FONT></FONT><FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN LANG="en-US"><B>
describes this intermediate netlist and gives examples<BR>See also
</B></SPAN></FONT></FONT><FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN LANG="en-US"><I><B>https://answers.launchpad.net/kicad/+faq/2265</B></I></SPAN></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B><I>2 - </I>The
intermediate Netlist File</B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>BOM files (and
netlist files) can be created from an Intermediate netlist file
created by Eeschema.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>This file uses XML
syntax and is called the intermediate netlist. The intermediate
netlist includes a large amount of data about your board and because
of this, it can be used with post-processing to create a BOM or other
reports.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>Depending on the
output (BOM or netlist), different subsets of the complete
Intermediate Netlist file will be used in the post-processing.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>3 - Conversion to
a new format</B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>By applying a
post-processing filter to the Intermediate netlist file you can
generate foreign netlist files as well as BOM files. Because this
conversion is a text to text transformation.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>this post-processing
filter can be written using Python, XSLT, or any other tool capable
of taking XML as input.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">XSLT
itself is a XML language very suitable for XML transformations. There
is a free program called </SPAN></SPAN></SPAN><I><SPAN STYLE="font-weight: normal">xsltproc</SPAN></I><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">that
you can download and install. The</SPAN></SPAN></SPAN><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">xsltproc
program can be used to read the Intermediate XML netlist input file,
apply</SPAN></SPAN></SPAN><SPAN STYLE="font-variant: normal"> </SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">a
style-sheet to transform the input, and save the results in an output
file. Use of xsltproc requires a style-sheet file using XSLT
conventions. The full conversion process is handled</SPAN></SPAN></SPAN><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">by
Eeschema, after it is configured once to run xsltproc in a specific
way.</SPAN></SPAN></SPAN></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>4 -
Initialization of the dialog window</B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>You should add a new
pluging (a script) in plugin list by clicking on the Add Plugin
button.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>4.1 - Plugin
Configuration Parameters</B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The Eeschema plug-in
configuration dialog requires the following information:</FONT></FONT></P>
<UL>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The title: for
instance, the name of the netlist format.</FONT></FONT></P>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The command line to
launch the converter (usually a script).</FONT></FONT></P>
</UL>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>Once you click on
the generate button the following will happen:</FONT></FONT></P>
<OL>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>Eeschema creates an
intermediate netlist file *.xml, for instance <I>test.xml.</I></FONT></FONT></P>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>Eeschema runs the
script from the command line to create the final output file.</FONT></FONT></P>
</OL>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>4.2 - Generate
netlist files with the command line</B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>Assuming we are
using the program <I>xsltproc.exe</I><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">to
apply the sheet style to the intermediate file, </SPAN></SPAN><I>xsltproc.exe</I><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">is
executed with the following command.</SPAN></SPAN></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>xsltproc.exe -o <
output filename > < style-sheet filename > < input XML
file to convert ></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2 STYLE="font-size: 11pt">On</FONT>
<FONT SIZE=2 STYLE="font-size: 11pt">Windows the command line is the
following.<BR></FONT><FONT SIZE=2 STYLE="font-size: 11pt"><I>f:/kicad/bin/xsltproc.exe
-o “%O” f:/kicad/bin/plugins/myconverter.xsl “%I”</I></FONT></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2 STYLE="font-size: 11pt">On</FONT>
<FONT SIZE=2 STYLE="font-size: 11pt">Linux the command becomes as
following.<BR></FONT><FONT SIZE=2 STYLE="font-size: 11pt"><I>xsltproc
-o “%O” /usr/local/kicad/bin/plugins/myconverter .xsl
“%I”</I></FONT></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN STYLE="font-variant: normal"><FONT SIZE=2 STYLE="font-size: 11pt"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">Where
</SPAN></SPAN></FONT></SPAN><SPAN STYLE="font-variant: normal"><FONT SIZE=2 STYLE="font-size: 11pt"><I><SPAN STYLE="font-weight: normal">myconverter</SPAN></I></FONT></SPAN><FONT SIZE=2 STYLE="font-size: 11pt"><I><SPAN STYLE="font-weight: normal">.xsl</SPAN></I></FONT><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><FONT SIZE=2 STYLE="font-size: 11pt"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">is
the style-sheet that you are applying. Do not forget the double
quotes</SPAN></SPAN></FONT></SPAN><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><FONT SIZE=2 STYLE="font-size: 11pt"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">around
the file names, this allows them to have spaces after the
substitution by Eeschema.</SPAN></SPAN></FONT></SPAN></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The command line
format accepts parameters for filenames:</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The supported
formatting parameters are.</FONT></FONT></P>
<UL>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>%B => base
filename and path of selected output file, minus path and extension.</FONT></FONT></P>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>%I => complete
filename and path of the temporary input file (the intermediate net
file).</FONT></FONT></P>
<LI><P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>%O => complete
filename and path of the user chosen output file.</FONT></FONT></P>
</UL>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>%I will be replaced
by the actual intermediate file name<BR><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">%O
will be replaced by the actual output file name.</SPAN></SPAN></SPAN></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>4.3 - Command
line format: example for <SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">xsltproc</SPAN></SPAN></B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">The
command line format for xsltproc is the following:<BR>< path of
</SPAN></SPAN>xsltproc > <SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">xsltproc
< </SPAN></SPAN>xsltproc parameters ></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>On
Windows:<BR><I><B>f:/kicad/bin/xsltproc.exe -o “%O”
f:/kicad/bin/plugins/netlist_form_pads-pcb.xsl “%I”</B></I></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><FONT SIZE=2 STYLE="font-size: 11pt">On</FONT>
<FONT SIZE=2 STYLE="font-size: 11pt">Linux:<BR></FONT><FONT SIZE=2 STYLE="font-size: 11pt"><I><B>xsltproc
-o “%O”
/usr/local/kicad/bin/plugins/netlist_form_pads-pcb.xsl “%I”</B></I></FONT></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><SPAN STYLE="font-variant: normal"><FONT SIZE=2 STYLE="font-size: 11pt"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">The
above examples assume</SPAN></SPAN></FONT></SPAN><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><FONT SIZE=2 STYLE="font-size: 11pt"><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: normal">xsltproc
is installed on your PC under Windows and all files located in
kicad/bin.</SPAN></SPAN></FONT></SPAN></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3><B>4.4 - Command
line format: example fo<SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">r
python scripts</SPAN></SPAN></B></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The command line
format for python is something like:<BR><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal">python</SPAN></SPAN><SPAN STYLE="font-variant: normal">
</SPAN><SPAN STYLE="font-variant: normal"><SPAN STYLE="font-style: normal"><
script file name </SPAN></SPAN>> < input filename > <
output filename ></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>On
Windows:<BR><I><B>python.exe f:/kicad/python/my_python_script.py</B></I>
“<I><B>%I” “%O”</B></I></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>On Linux:<BR><I><B>python</B></I>
<I><B>/usr/local/kicad/python/my_python_script.py</B></I> “<I><B>%I”
“%O”</B></I></FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto">
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>Assuming python is
installed on your PC.</FONT></FONT></P>
<P LANG="en-US" CLASS="western" STYLE="margin-bottom: 0cm; widows: 0; orphans: 0; page-break-before: auto; page-break-after: auto"><A NAME="__RefHeading__1787_435485510"></A>
<BR>
</P>
</BODY>
</HTML>