kiutils icon indicating copy to clipboard operation
kiutils copied to clipboard

Broken as of KiCAD 8?

Open evantandersen opened this issue 4 months ago • 2 comments

It seems KiCAD 8 changed the file format enough that KiUtils opening, parsing, and saving a PCB will corrupt it and prevent it from being opened.

To replicate:

  1. Open a KiCAD 7 PCB in KiCAD 8, you will get a notice about upgrading the file format upon save.
  2. Save the PCB to change to new format
  3. Board().from_file("foo.kicad_pcb").to_file()
  4. Try to open it in KiCAD 8, no dice!

evantandersen avatar Feb 29 '24 09:02 evantandersen

An interesting note is that there's been rumblings on the discord about revamping the scripting interface for KiCAD 9, perhaps that will replace KiUtils? Not sure if there is a use case for externally-parsing the files vs. doing it live in the editor.

I used KiUtils for my project originally because it was much better documented / much simpler than the crazy pcbnew python system that currently comes with KiCAD. However, having to save, close, run a python script, then re-open my board everytime I want to update something that's scripted is a bit of a pain. Perhaps in the future we can have the best of both worlds?

evantandersen avatar Feb 29 '24 10:02 evantandersen

Hello, KiCad 8 is not yet supported and its possible that there are breaking changes from 7 to 8 which kiutils does not yet account for. I haven't yet had time to look into the changes KiCad 8 brought, but its on my agenda to do so.

For the use-cases you described, the pcbnew internal scripting interface is of course more suited. However, i wrote kiutils initially to be able to process KiCad-related files outside of the KiCad environment. A few other use-cases for kiutils might include:

  • automatic script-based generation of footprints, parts, boards, etc.
  • commit hooks in git (an example would be removing filled zones before committing changes into the database)
  • parts management outside of KiCad (e.g kitree or Ki-nTree)
  • you name it

so, regardless of what happens to the pcbnew scripting interface, kiutils will still deliver value in being independent from KICad and lightweight to integrate.

mvnmgrx avatar Apr 04 '24 18:04 mvnmgrx