Regarding these files: File1: https://gitlab.com/kicad/code/kicad/-/blob/master/eeschema/plugins/python_scripts/kicad_netlist_reader.py
and File2 (+line of interest): https://gitlab.com/kicad/code/kicad/-/blob/master/eeschema/plugins/python_scripts/bom_csv_grouped_by_value.py#L84
Also, regarding this thread: To exclude Virtual footprints from BOM [SOLVED]
What do I want: I am trying to make custom csv bom, based on File2. I want to exclude DNP (Do Not Populate) components from BOM, if component has “DNP” field and this field is not empty. All symbols on schematics have “DNP” field, and in case this field contains a value, BOM script should ignore it.
Question #1 is: Can this be done in other easy way instead of modifying File1? I mean File1 is part of kicad’s installation, why should I modify that? Nobody should temper files, created by software installer, I think. These files will probably get overwritten next time software update is available, thus causing my modifications to be lost.
Explanation:File1 is hardcoded to omit components, having field
"Installed" = "NU", and I want to change this to
"DNP" != "". So, I go to https://gitlab.com/kicad/code/kicad/-/blob/master/eeschema/plugins/python_scripts/kicad_netlist_reader.py#L627 and append these lines there:
if c.getField( "DNP" ) != '': exclude = True
Now my custom BOM script only prints what I needed, but accomplished this by modifying kicad installation file…
Just a note, that @qu1ck 's iBOM https://github.com/openscopeproject/InteractiveHtmlBom plugin works the same way, it has a dedicated setting for that:
It successfully omits components, with DNP field not empty from html BOM. I want to do exactly the same, but from eeschema BOM plugin.
Question #2: Maybe File1 in kicad master should be improved to be more flexible? Is this worth filling an wishlist issue in gitlab, or is it intended for users to modify File1?**
Question #3: Can this “configuration” section lines 26 https://gitlab.com/kicad/code/kicad/-/blob/master/eeschema/plugins/python_scripts/kicad_netlist_reader.py#L26)) to 71 be changed (overridden) from outside code? (My python knowledge is zero)
To be more clearer about q#3: iBom plugin has these blacklist configurable, it would be perfect if the same configuration options would be available from python code):
(Mentioning iBOM here a lot because it is the most valuable addition to kicad as I know…)