BOM frustrations

Trying to get a half decent BOM produced. I figured I’d start with the provided ones (I had an xslt one working but it doesn’t appear to supported anymore?)

I figured I’d start with a grouped by value before changing it to grouped by PN since value is not unique per part. I quickly run into issues

First the export is filled with rev 6 links

Second there are no Rev 7 links but there are links with no rev that connect to nothing

This I can correct by manually inserting a rev

I assume this is an outstanding bug in the upgrade process and I’ll have to clean out all the rev 6 references and add Rev 7 references

Even when running that the result is not grouped by value, as promised in the description, but simply sorted by reference designator.

Finally there doesn’t appear to be an application directory since KiCAD has apparently chosen to put these files in the executable directory which adds a layer of additional annoyance before being able to add files with a modified output.

So in summary

  • I don’t have a BOM output that will generate a BOM grouped by PN (I didn’t really expect that since PNs are not present by default)
  • I don’t have a BOM grouped by value, so I don’t have a template to modify to use PNs
  • I don’t have instructions on making such a BOM since the manual devotes all of 3 paragraphs to BOMs
  • Even if I do have the above I need to poke around the security system to add a new BOM generator

Now it’s possible, maybe even likely, that all of the references, instructions and template examples exists but I can’t find them. So what am I missing?

Application: KiCad Schematic Editor x64 on x64

Version: 7.0.7, release build

Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 6.0.0
FontConfig 2.14.1
libcurl/7.88.1-DEV Schannel zlib/1.2.13

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Aug 14 2023 02:42:39
wxWidgets: 3.2.2 (wchar_t,wx containers)
Boost: 1.81.0
OCC: 7.7.1
Curl: 7.88.1-DEV
ngspice: 40
Compiler: Visual C++ 1936 without C++ ABI

Build settings:
KICAD_SPICE=ON

Robert

For your delight, the future v8 will have a new BOM creator.

May the old one rest in peace, or be used by old dogs who don’t learn new tricks.

(EDIT: apparently the dialog has been copied from “Symbol Fields Table” dialog, therefore it has wrong title.)
(EDIT 2: no, this is the old dialog but exporting as BOM has been added to it. There are two menu items opening this dialog.)

2 Likes

Use “bom_csv_grouped_extra” script.
You can specify additional fields (PN in this example) by adding them to the command line:

python “C:\Program Files\KiCad\7.0\bin\scripting\plugins/bom_csv_grouped_extra.py” “%I” “%O.csv” “PN”

2 Likes

I suspect you have added these scripts while still in an earlier version. The list has been kept when migrating the configuration to v7. I wouldn’t say this is an outstanding bug. Annoying, yes. But as far as I remember, even though KiCad comes with these scripts, they must be added to the list manually which means the end user is responsible for the list.

It happens pretty often that when you do a thing once you won’t remember doing it after a year. Maybe you have forgot you did it? For me, clicking the + button opens the plugin directory where these are supposed to be if they are pre-installed.

I don’t know why.

The script seems to have written something else differently, too, for example “Individual Components” vs. “Collated Components”, and the generator path is different. Try removing the generators from the list and re-add them properly from v7 installation (after making sure you actually have the wanted files in your up-to-date installation).

1 Like

I don’t think so.
With V5 I modified (with help of people at forum) bom_csv_gruped_by_value_with_fp to fulfill my needs. When upgrading to V6 I would be not happy if I quietly would lost my modifications.
With V7 I decided to use KiCad’s current version of generator and just adopt spreadsheet I use to finalize my BOM to format I get from it and not to modify generator. I don’t remember how I have done it but probably by using [Reset to Defaults] key.

I use that script to generate my BOMs, it generates two parts in the file, first the whole component list and if you scroll down, the components grouped by value. I always have to delete those first rows (after every time I regenerate) doesn’t bother me too much.

That looks nice. Only missing a sort specification but that’s easily done externally.

Oh, that’s entirely possible. Still seems a bad idea to just link to old version without updating to the new versions. Sooo many subtle nearly untraceable bugs are possible that way.

The key is grouping by them though.

A-Ha!

There’s the key. I missed that the newer version was outputting a file with no extension. From there it was easy to create a version with grouping by PN and extraneous columns trimmed.

It still sorts by reference designator (I can’t image that being useful except in very artificial situations) but I can manage that externally. I don’t see a way to change that without editing the support files.

BTW, the DNP support is a nice addition (I’d been having to prefix PNs with DNP to perform the same purposes easily).

That’s why you never modify the files that come with the installation (That conclusion was obvious even 30 years ago, longer but I was slow to recognize it). You always add new configs, scripts, parts etc. to a user/organization location. Modifying shipped files is a last resort, there’s a legion of ways that can break even if new installations don’t provide entirely new files that remove any references to the old, which they should for a clean install.

KiCAD at least doesn’t make using new scripts impossible. They are too dependent on being in the program directory but at least you don’t have to overwrite existing files

That script groups by all fields, to prevent the case where some fields may get overwritten.

I looked at the script while editing, it does not group by all fields only a subset.

This is the function that provides the grouping, note it groups only on value, name, footprint and DNP. All other fields are ignored for grouping. There’s also no provision for adding (or removing) field from the grouping

def myEqu(self, other):
“”"myEqu is a more advanced equivalence function for components which is
used by component grouping. Normal operation is to group components based
on their value and footprint.

In this example of a custom equivalency operator we compare the
value, the part name and the footprint.
"""
result = True
if self.getValue() != other.getValue():
    result = False
elif self.getPartName() != other.getPartName():
    result = False
elif self.getFootprint() != other.getFootprint():
    result = False
elif self.getDNP() != other.getDNP():
    result = False

return result

In fact grouping on all fields is the same as grouping on none.

Ah, I see you were referencing another script. Missed that, sorry.

Yep, that is cleaner. Still doesn’t let you remove fields or sort differently but it’s a big step up.

Column order is messed up but I could live with that.

Sorry. I expressed myself imprecisely. I copied KiCad file to my directory and modified it there. Then configured what was needed (it was around 5 years ago, don’t remember each step) to use it when I generate BOM.
I understood (may be wrongly) that (when upgrading to new version) not loosing the connection to the old boom script is told to be a bug. For me when you make clear install of new version than you should get new scripts to be selected to generate BOM and don’t suppose it is not so. But when you specify to use your configuration from previous version than you should have the scripts that you had before.
I’m not sure what exactly was said to be a bug.

I modified several of the BOM scripts and finally dialed-in two that I use. These were done in v5 and I keep them in a non-kicad folder and place copies in the kicad Scripting folder and point to them for usage. I use kicad v7.

By ‘dialed-in’ I mean that I edited them to get what I want for my personal usage so, they produce a minimal amount of info.

One is for HTML, the other is for CSV but, aside from HTML/Webpage viewing, they do the same thing.

Focusing on the CSV for this Post, the screenshot… I use Libre-Office and made a Macro to pretty-up the result but forgot to Left-Justify the count value and one or two other minor things that are just as easy to click and get the results.

You can add/move/etc stuff as needed (look at some other CSV BOM scripts to get ideas). The Red lines/arrows show important stuff and is where you’d add other items.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.