kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #44889
question about XML BOM output
Hi,
When using jlcpcb-kicad-tools, it's tedious and error prone to fill in
the LCSC_Part for all components, so I'm thinking how to automate this
from a database/CSV file of preferred parts.
I'm thinking one could make a BOM plugin that processes the XML and
matches value and footprint (package) to insert the correct LCSC_Part.
Looking at the XML, it looks for example like this:
<comp ref="D1">
<value>5819</value>
<footprint>kymatica:D_SOD-123</footprint>
<datasheet>~</datasheet>
<fields>
<field name="LCSC_Part">C8598</field>
<field name="Spice_Lib_File">/Users/lijon/Dropbox/Electronics/Spice-Models/easyeda.lib</field>
<field name="Spice_Model">0</field>
<field name="Spice_Netlist_Enabled">N</field>
<field name="Spice_Node_Sequence">2 1</field>
<field name="Spice_Primitive">R</field>
</fields>
<libsource lib="kymatica" part="D_Schottky"
description="Schottky diode, small symbol, filled shape"/>
<property name="Spice_Primitive" value="R"/>
<property name="Spice_Netlist_Enabled" value="N"/>
<property name="Spice_Node_Sequence" value="2 1"/>
<property name="Spice_Lib_File"
value="/Users/lijon/Dropbox/Electronics/Spice-Models/easyeda.lib"/>
<property name="Spice_Model" value="0"/>
<property name="LCSC_Part" value="C8598"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="NoiseGrain.kicad_sch"/>
<sheetpath names="/" tstamps="/"/>
<tstamp>00000000-0000-0000-0000-00005d77ea7f</tstamp>
</comp>
How come each custom field is repeated both in <fields> as well as
having a <property>? Which one is used?
Is there any way to read such an XML file back after processing it? Or
is there a plugin API to process the schematic in place to fill in
those LCSC_Part fields?
--
/Jonatan
http://kymatica.com
Follow ups