Python Scripting Example: Studio Clock

Thanks for the update. I guess I’m out of luck. I thought I might be able to adapt it if I could download the zip, but maybe the scripting language has changed too much.

Well, I’ve tagged him so if his account is set to receive updates all might not be lost. You could also try PM. That will almost certainly send an alert if he has it set and hasn’t changed emails.

EDIT: This seems to be the github repo:

It links back to this thread.

I also found an old copy among my own bitcollection.

2017-08-06_KiCadStudioClock.zip (37.8 KB)

This file also seems to be related:
schematic.py (1017 Bytes)

The scripting language used is python, and that has not changed much, but KiCad’s file formats have changed. The schematic format has been completely redesigned for KiCad V6, while (I think) the changes in the PCB format are much smaller, but I don’t know details.

And the origins of SKiDL:

Thanks for doing that. I have some reading to do now.

Thank’s for the zip file. I hadn’t distinguished between the scripting language and the Kicad file format. That’s good to know.

@hermit I do still watch this thread (or better the mail told me i still watch) and still have the source files.
@paulvdh thanks for re-posting the zip

Since this issue seems to come up regularly, it seems appropriate to update my 5 year old script (which is still in Python 2) and publish it on GitHub or similar. It would be great If anyone (maybe @jerseyp2) has the time and spirit to do this (I could then update my original post with the link).

2 Likes

@DougE Since I’m using FreeCad and the KicadStepUp plugin, and trying to incorporate some kind of enclosure for the PCB, I thought I’d try to see if I can create a script to take my Kicad LED model positions imported into FreeCad, position them, and then use KicadStepUp to push the positions back to Kicad. It doesn’t get me the traces, but it might be possible to implement, and I’m new to Python, so it’s a challenge.

I’ve used the Lattice2 workbench to set placements for 300 LEDs on a circle, and now I’m slowly trying to figure out how to programmatically attach the LED STEP files to those placements. I’m trying to keep it parametric, so I’m driving it from a spreadsheet. Small steps. I hope someone has the time to update your script. It’s an impressive project, and I’m going to study it more when I have a chance. Thanks for posting an updated comment.

There are a lot of useful plugins for kicad v6 with open source, just go to plugin manager and browse. They all have github/gitlab links.
Not to say that having this script ported to v6 and python3 wouldn’t be useful, just pointing out other sources for someone who needs good working examples.

You can use Place footprints action plugin that is available through KiCad’s Plugin and Content Manager

just a quick note that I have started to work on porting it myself, I might finish it this weekend

For something similar, I used:

It takes in a YAML configuration file to decide how to place components.

…And I wrote a python plugin to generate the YAML for my particular board. It avoids custom plugins for each project, and both the Python generator and YAML configuration lives nicely in a repo.

I have finished updating the code whereby I have completely changed everything except the logic as I was absolutely not happy with the code style I had 5 years ago. The script is designed only for standalone usage with hard coded relative file path. Have fun.

5 Likes

Wow!!! Just joined the forum and the new replies on your post helped me find your project. Your scripting is pretty good and I’d like to learn.

Hi Devbisme,

It is great design,what if make it become final item,and test quality,I would like to expect the masterpiece what you design,tks