Hey guys. I have some scripts that work on
.sch files and not on the new format (yet).
So, I am wondering here if someone has a script, program, or any solution to convert the new
.kicad_sch format to the old one (
.sch). This is temporary to have the scripts working since I still want to have my project on Kicad 6
Hey guys. I have some scripts that work on
There are no scripts to downgrade from V6 to V5 and I doubt there will even be due to the number of formatting changes on V6
Maybe officially there are none. But maybe someone has one. Or maybe someone has an idea on how to make one using parts of the Kicad’s code.
Let’s say using
.kicad_sch parser from version 6. And then the save
.sch schematic from version 5.
Is this possible? From my end I think it is not possible and I will be camping here to see if someone else has such solutions
Maybe it works for you to temporarily change
For those who want to try it on Windows (backup files first, and then run as admin or change permissions of folder
git apply …/
# open and save the schematic, and rename it from *.kicad_sch to *.sch
git apply -R …/kicad-6.0.2-x86_64-sch.diff
Edit: Same for KiCad 6.0.3 on Windows 64-bit:
kicad-6.0.3-x86_64-sch.diff (276 Bytes)
Edit: Same for KiCad 6.0.4 on Windows 64-bit:
kicad-6.0.4-x86_64-sch.diff (276 Bytes)
Hey @mgyger thanks for this suggestion. I don’t use windows. Why do you mentioned it?
Ah, so do you already have a .exe with this change to share? I can find a Windows machine to test this pretty quickly.
I still working to build Kicad for the first time on my Linux box. If you have this file, maybe others could test it pretty quick too.
So, my idea is to reduce Kicad to a subset of it (which is also simpler to compile), that does this conversion, allowing me to pass the
.kicad_sch from the command line, and outputting the old-style
.sch without manual intervention.
My use case is to have a way to export SVG from the schematics with
plotgitsch (which works on
.sch files only) while Kicad doesn’t have a python API for that.
Other users could have other use cases for that for sure.
Now, what is this
Above for Windows x64 is a binary patch for 6.0. already (it simply does
pluginType = 0 by changing 2 bytes using
git). So if you send me your particular version of file
/usr/bin/_eeschema.kiface (which is the actual binary/executable of eeschema) or point me to the correct package, I could take a look at it…
Edit: On 6.0.3 on Windows it’s called
I am not sure if I am doing something wrong, but there is nothing on that link. Just the WeTransfer without any file to donwload.
Now, if I send you the binary of my
_eeschema.kiface you are saying you can patch the binary directly? In this case, here it is Dropbox - _eeschema.kiface-orig.6.0.2.linux - Simplify your life
Alternatively, the package I am using is this one,
kicad - 6.0.2-0-202202110812+378541a8eb~116~ubuntu21.10.1
OK, let’s try… Assuming you saved
kicad_6.0.2-0-ubuntu21-sch.diff (266 Bytes)
(an ASCII file) in
/tmp, try the following (maybe
git apply /tmp/kicad_6.0.2-0-ubuntu21-sch.diff
Now hopefully the correct 2 bytes should be patched, and you can open and save (overwrite) a copy of a schematic, and then rename it from
*.sch, and it should be in the old format…
git apply -R /tmp/kicad_6.0.2-0-ubuntu21-sch.diff
Alright, you are saying that I can patch it myself the binary itsefl. Why dont you mention it before. Cool, I am testing here.
I copied the binary to a folder to patch it. And then I am getting this.
Is it possible to test this on a copy of it or it has to be the original file?
➜ eeschema ls
_eeschema.kiface kicad_6.0.2-0-ubuntu21-sch.diff patch.sh
➜ eeschema ./patch.sh
error: the patch applies to '_eeschema.kiface' (1008ed7985ca10dee7e122164e90e9d2b7deb11e), which does not match the current contents.
error: _eeschema.kiface: patch does not apply
Ah, should I be inside a git repo?
You need to use the command
git apply kicad_6.0.2-0-ubuntu21-sch.diff
in the same directory where
No, just use
git apply with the diff file anywhere.
Fixed my comment here to avoid any misunderstanding.
I have these 2 in the same folder
Being inside of this folder, I am applying it with
➜ eeschema git apply kicad_6.0.2-0-ubuntu21-sch.diff
warning: _eeschema.kiface has type 100755, expected 100644
-R (this is to revert the patch).
Of course, sorry. It workd. Let me test
cmp -l _eeschema.kiface.orig _eeschema.kiface
you can see that only 2 bytes have been changed.