KiCad8 scripted BOM from Schematic

it is not a data problem. the “problem” is, with the current, script based approach I directly control the process on how the CSV is generated. If this process is now internal to kicad I can’t do that anymore, so it adds another step, not executable in kicad directly, which takes the generated CSV (or the schematic data directly via API) and processes it further. But it is not really a problem, we just have to adjust the workflow to this change at some point.

With the current process, you have a script that converts XML to CSV

With the proposed new process, you have a script that converts CSV to different CSV, right?

Keep in mind that with kicad-cli you can already control some aspects of how the CSV is formatted.

with the difference that I can’t call this script directly from KiCad, but yes. To get it into kicad as a “one-click” solution you then need to modify the script to work as a plugin for the PCB editor (or maybe also schematic editor if plugins get support there), this scripts then either calls the CLI or uses the API directly to get the required information out.

After switching to v8 now I checked the new bom tool and it’s clear that it is not usable for our purposes. It would be good if the support for the legacy boms could stay until a different way of extracting schematic information is implemented (e.g. the schematic python API)

It is not really helpful to say this without saying why. Have you considered opening feature requests to expand what the new tool can do?

I explained it before: We need full control over the process of processing the schematic information and creating the BOM file as we do a lot of background stuff which KiCad shouldn’t handle built in (like talking to various servers, executing other programs etc.), because its to specific for our companies procedures and not useful for the generic user. The scripted BOM generator was perfect for this, as it allowed us to do whatever we wanted with one click from the BOM tool and change it independent from KiCad updates.

I don’t really see any sense in creating a feature issue for this, as this feature is already there and the decision was made to phase it out. as long as it is supported until another way of interacting with the schematic information from self maintained programs is implemented, I am happy.

According to the manual (On my system in: file:///usr/share/doc/kicad/help/en/eeschema.html#bom-export) it’s still possible to run custom scripts for the BOM. There is also a pointer towards: I have not used the BOM myself (I do less projects with KiCad then some infer from my presence on this forum) but I do believe that custom BOM scripts are important. I guess that maintaining compatibility with the old BOM scripts should stay at least until there is full scripting inside the schematic editor.

Also, just under Schematic Editor / Tools / Generate BOM there is a Schematic Editor / Tools / Generate Legacy BOM.

I also bumped into a bug apparently. When I press on: Schematic Editor / Tools / Generate BOM, then KiCad locks up with one processor core at 100%. I’m not sure whether to report this because I do not have much experience with the BOM part. Can others reproduce this?

Application: KiCad x86_64 on x86_64

Version: 8.0.1-8.0.1-0~ubuntu20.04.1, release build

Libraries:
	wxWidgets 3.2.2
	FreeType 2.10.1
	HarfBuzz 2.6.4
	FontConfig 2.13.1
	libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3

Platform: Linux Mint 20.3, 64 bit, Little endian, wxGTK, X11, xfce, x11

Build Info:
	Date: Mar 14 2024 15:11:44
	wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.6.3
	Curl: 7.68.0
	ngspice: 42
	Compiler: GCC 9.4.0 with C++ ABI 1013

Build settings:

Can you provide an example project with this issue? Or does it happen with an empty project?

Is it really critical for you to have a one-click solution within KiCad, instead of a one-click solution outside of KiCad (which uses the CLI)?

Lets hope that the schematic editor eventually gets the Python API that have been planned for quite a few years. That should solve the issue.

I’m also using a custom script and the now legacy BOM generator. I won’t start using the CLI as long as the legacy BOM generator exists. But if it’s removed, I’ll switch over to the CLI.

not critical, but convenient. We have now more or less every step of our release process integrated inside of KiCad so putting one thing out again would be inconvenient.

Hello,
I would only be concerned if libraries like kiutils failed to keep pace with the format updates in new versions of KiCad. Otherwise, I can always read the .kicad_sch and .kicad_pcb files.
I’m not an expert programmer, yet I managed to create my script within a week. I’m confident that someone else could do it even more quickly.