Scripting Eagle import

I have several dozens of old Eagle projects which I’d like to make available in KiCad for referencing etc., so I’d like to automate the import/conversion process. I’m new to scripting KiCad, and I had a look at the Python API, but so far I haven’t found what I need or where exactly to start.

The manual process I’d like to script goes like this:
Open KiCad, Import Project -> Eagle CAD, select an Eagle schematic file, create a folder for the new KiCad project, save the converted schematic, save the converted layout and finally generate an interactive BOM.

Is this feasible by just passing parameters to the KiCad executables or do I have to write a script that runs in KiCad? I’d like some high-level overview about how to tackle this project. Some pointers to documentation would be appreciated as well…

As far as I know there is only a scripting capability build into Pcbnew. Not in the KiCad project manager, nor Eeschema. There is no interface to scripting available to users at the moment (Maybe in KiCad V6?)

However, The Eagle to KiCad conversion has been an external script for a long time before it got integrated in KiCad.
For single use it’s convenient the conversion script is baked into KiCad, but for batch processing it’s probably a better route to use it from an external (Python?) script.

1 Like

I wonder if the script is up to date anymore, since the feature is now built-in.

2 Likes

Yes, but what does “built in” mean?

Several years ago the conversion was an external Python script (If I even remember that well) I think I ran it once or twice just to see if it worked, and it did.

Then, before the introduction of KiCad V5, when the conversion scripts got integrated into KiCad, quite some work was done to update the scripts and add missing features.

Then I bumped into rosco_m68k on hackaday, and there was some interest to convert it from Eagle to KiCad, so just for fun I did the initial conversion and mailed it to them.
The initial conversion was quite fast (few minutes to figure out which buttons to press, run DRC for verification). Still I put a few hours into it for cleanup.

“Cleanup” can take many hours, depending how critical you are, and some things are handled differently in KiCad. Named busses over hierarchical sheets worked with the scripts, (DRC free) but converting it to “doing it the KiCad way” and also look good takes time.

Other Issues was replacing named nets with KiCad power symbols, and lots of labels with very small text, which I left in the project because I had no idea what they wanted to do with their project.

All this “cleanup” was in the schematic. The PCB conversion was very smooth and complete.

– 8<----- 8<----- 8<----- 8<----- 8<—
Back to batch scripting.
I would not recommend to use the 2 or more years old scripts.
I do not know how current KiCad handles the conversion.
It may still be python scripts (why re write it?) but just no scripting interface available for uses in KiCad. If that is so, then it may be doable to call these scripts from a short glue script in Python.

Another way I would consider seriously, is to simply do nothing at all.
The current KiCad can open / convert an Eagle project in such a seamless way there is not much need for batch processing for conversion. Just open the Eagle project in KiCad and save it as a KiCad project when needed.

@Crasor: Have you (manually) converted any of your Eagle projects to KiCad yet? Doing a few manually gives you a good idea of the amount of work involved, and this depends greatly on a lot of factors, such as:

  • How complicated the schematic is. (Flat sheets vs. Hierarchical etc).
  • Use of (named) busses.
  • How fussy you are, how “neat” does it have to be?
  • How much “cleanup” do you prefer to do?

How many of these “few dozen” Eagle projects do you actually need? The old Eagle projects will stay the old Eagle projects (newer Eagle file versions may (someday will) break the scripts. The Eagle -> KiCad conversion is only expected to improve over time.

For “a few dozen” not much time is to be gained by batch processing, especially if you have to spend time on figuring out how to interface with existing scripts.

Also: I’ve heard some rumours that scripting for KiCad V6 may become available in Eeschema. Such scripts may help with the cleanup, which easily takes much more time than the conversion itself.

Today it’s written in C++. I don’t know why.

I did quite a few manual conversions. I don’t care too much about the issues that occur, I don’t want to continue to work on most of those old projects, so no cleanup required. I want those projects for reference (component placement, find netnames/pins/pads etc.) while repairing or for looking up how something was done in an old schematic. I don’t want to be switching back and forth between Eagle and KiCad for that. Also I would love to have an interactive HTML BOM for all our PCBs without having to manually convert a project every time I look something up.

TBH, I’m not even sure how many dozens there are, we are talking about years of professional work :slight_smile:

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