KiCad 9.0 Python API (IPC API)

The API is already stable (meaning we are already following our stability practices when making changes during 9.0)

We will make the decision whether or not to completely remove the old SWIG support in V10 based on what we know about the new API’s ability to support people’s needs. If you wait until V10 to test whether or not the API meets your needs, and you happen to have a need that nobody else asked for earlier, you risk losing that ability until it can be re-added.

1 Like

Ah, I see…
I enabled the trace output for the API subsystem. The strange thing is that after I did that the plugin icon was loaded. :confused: But I found a few issues and it still works after removing the environment variables again.
Thank you!

So, I am just trying to create the schematic and layout using Skidl but it is not working for creating schematic so now I get to know about this API. So any one please tell me that this API can be used for the above thing I mentioned.

@devbisme is the developer and contributor here.

There is no API for schematics yet, new API (and old one) is pcb only for now.


The program freezes here

Thanks for the clarification qu1ck

Just wanted to make sure that my thank you post (Thank you. Thank you. Thank you) also reaches you directly :slight_smile:

Since I don’t get much / any traction on my other posts and I really struggle with the documentation of the API, I’ll try to revive this post, maybe I can get more feedback here.

Posts I made that were left mostly unanswered:

  1. IPC Plugin debug prints
  2. IPC-Plugins: Visiblity-Flag for text

Currently I’m struggling with the creation of a pad (that I use as a fake-via in a footprint). I got so far that I now have a plated hole, but I don’t understand how I create the annular ring / the pad itself. Currently I’ve got this:

fake_via = Pad()
fake_via.number = ""
fake_via.position = Vector2.from_xy_mm(10, 10)
fake_via.padstack.unconnected_layer_removal = True
fake_via.padstack.drill.diameter = Vector2.from_xy_mm(0.3, 0.3)

This seems to be the attribute I’m looking for. However, I have to set this per layer, which seems strange to me, because the UI in KiCad lets me set this as a “global” setting:

okay, slight progress, but I think I ran into a bug. I can set the pad diameter this way:

for layer in fake_via.padstack.copper_layers:
	layer.size = Vector2.from_xy_mm(1, 1)

However, the created pad looks like this:

Note that the “Pad Properties” dialog shows how I expect it to look, but it does look different on the board. Toggling a setting like “F.Mask” and then pressing OK fixes it on the board without changing anything. This seems like a bug that prevents the update of the pad.

@craftyjon Sorry for the ping, but it seems like no one is answering any of my posts about the API and I think you should be aware of this feedback. Especially since I think I ran into a second bug. Both of them could be related though, both of them look like as if some update has to be triggered in KiCad.

Edit: I’ve update to v9.0.2 and the behavior is unchanged.

Editt 2: I should also mention that I ran into issues every now and again if I have more than one KiCad instance open.

Trying to open a UI created with the IPC API from within KiCad creates this error:

This does not cause any problems when using the old SWIG bindings. Maybe it is an issue with my code, but the same code works with the old bindings.

Bugs should be reported on GitLab, please. Forum posts are not a place to report problems with the API, your issues will be lost.

My last report on GitLab regarding design rules was mostly ignored in the last three weeks, so I wanted to make sure it is an issue with the API and not my understanding of the API. Especially since I’m not sure if I should report that I’m unable to create pads - this could be entirely on my code, hence I asked for help.

But if you prefer, I can create a few issues.

I am currently unavailable to investigate bugs or give help, sorry. Maybe someone else will step in, otherwise please be patient. Issues are the best way to make sure that when I am available later on, things aren’t totally lost.

1 Like

FYI, when padstack mode is simple, only the first (F_Cu) layer is used. Likewise when padstack is front/inner/back, only F_Cu, In1_Cu, and B_Cu are used.

1 Like

ahh, that is good to know. That probably already resolves one of the issues I just created. I know you guys have lots of things to do, so I don’t blame you, but the documentation on the API is really bad. It is more helpful to look through the code than to actually take a look at the documentation.

I created a few issues :smiley:

You are welcome to submit changes that improve it. Using the API is expected to require looking through the code, though, at least in the near term. There has intentionally not been any effort put into documenting it to the level where people would be expected to get things done without ever looking at the code

The documentation also is never going to cover everything about how KiCad works, e.g. what is a padstack etc. The user is assumed to be knowledgeable about that.

1 Like

Makes sense! I was just confused about the basically empty doc page.

I probably don’t have time next to work and trying to get this to work. But I’ll keep it in mind. For now I know too little to write any meaningful documentation