Manufacturing files generating script

Hi everyone,
I wrote a script that generates everything needed :

  • Gerber
  • Drill Map
  • Position file

It awaits either :

  • No argument : It automatically detects the existing kicad_pcb in the working directory
  • Multiple files : generates gerber for each file.

It also generates a zip file to directly send it to the fab.

All comments are welcome ! Feel free to reuse/modify :wink:

Salamandar

Awesome! I was just looking for something like this.
I will test it right away :slight_smile:

Just a quick comment: the KiCad python interpreter still uses python2.
This means that the script is imported to KiCad’s python console, it will crash when opening files for write (because of open(..., newline=''). Removing the newline part seems to do the trick.

Anyway, good job!

Not anymore it does not !
If your distro-provided build is still using Py2, please ask the maintainers to add the CMake build flag KICAD_SCRIPTING_PYTHON3=ON.

About the Py2 compatibility, removing newline may create an odd (but correct) CSV file. According to the internet, you can use :

import io
io.open(…, newline='')

KiCad on windows sadly requires python 2.

OK, let me rephrase that: the nightly version for my OS (macOS) uses python2. I wasn’t aware of different versions of python in different versions of kicad. My bad.

@Rene_Poschl, do you know if it also applies for macOS?

Thanks!

I was a bit trolly in this message :wink: I know some platforms are not fully py2 compatible, as the py3 port is very new. (To be honest I didn’t even think about MacOS)
Was newline the only change required for python 2 ?

No problem :slight_smile:
Yeah, by changing those 2 lines everything worked OK.

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