Back import custom fields


#1

I have custom fields in all components as Digi-Key Part Number and Manufacturer Part Number. And I have bill of materials with info for this fields ( which was manually added)
Is it any way to back import info from bill to schematic components? On schematic more then 1k components, it will be too hard and to long to edit each component manually.


#2

Kifield may help (search on this forum, or github) - But you may have to accept the large change in your schematic files as of now.


#3

The symbol field editor (found in the tools menu of eeschema) of version 5 can be used for this.
One can select any number of cells and copy their content to for example libre office calc.

The other way round works in the same manner. simply copy the stuff from calc and pate it into that table view.

You might need to deselect “group by value” as you do not have it grouped that way in your table.

I have tested this in both version 5.0.2 and in the current nightly builds.


#5

I just public this bom_plugins/bom2sch.py from here, it may help you to backport value if the custom fields already defined in your schematic;

{EDITED}

  • python bom2csv.py XXX YYY Where input file XXX can be root .sch file, or .xml file. YYY is a output csv file name
  • python bom2sch.py YYY [XXX] Where output file XXX can be root .sch file. YYY is a input csv file name.

What version of KiCAD should I download? [solved]
Linux command line tool to generate XML BOM
Migrating from KiCad5 to KiCad6
BoM crashes KiCad
Bring Back CvPcb with Advanced Features!
True components library
True components library
Upgrading KiCad 4.07 to Kicad 5 missing all symbols
Managing alternative component footprints
How to repeat multiple layout blocks?
New Project - BOMGarten - Bill of Materials tool and scraper
#6

Just add Population column for DNP so if some one want to reserve the Value of Components.


#7

nhatkhai - how is your script different from KiField?


#8

@4b11b4,
The main difference is that - it would not rewrite the whole .sch file, instead it act like search and replace. Therefore, the new .sch file will be result in minimal change. So people can using diff tools to just see the “real” changes.
[EDITED-13Feb2019] Only ROOT .sch file needed, where KiField you need to specify all the .sch files in the project - but this would introduce the risk of update the “wrong” reference in the project where one schematic file use in multiple hierarchy blocks.

The secondary is that, it do not remember all the .sch in memory. Therefore, it should be able to handle however big the project is.

The other minor together with the bom2csv.py - It is flexible to recognize the special field names from many difference names. You can read the first couple line in https://github.com/nhatkhai/kicad_scripts/blob/master/bom_plugins/bom2csv.py to see more detail on this.

I also try to make it in the way, it can be quickly modify for other new file format, and event do similiar think with .kicad_pcb, kicad_mod, lib, dcm… But I’m not having any use case for them yet. So I just do what I need for now.

KiField still have more features. I try to use it for some of my use cases, but I found it going to take more time of discussion before code change which I’m not good at.


#9

Also - I can easily add couple more line of code for doing BOM as multiple configuration (difference build). By have multiple table for each section of circuitry with difference configuration names. Then the script can pick a set of tables to apply back into sch…


#10

I also thinking about bom2sch eventually replace bom2csv and become just bomConverter or something. But depend how and when I need these use case in my next project. So avoid reading the XML file, but directly from .sch files. If KiCad change file format, that should not be issue for me. Only small section of code need to be added.


#11

Or to a single BOM table csv for send to assembly house :-).