About kicad-plugin for auto-schematic

Hello. I have tried to make a KiCad extension using FastAPI to auto-apply components like capacitors and resistors to KiCad schematic, but I cannot get the pcbnew or kicad-skip to work as I want. I have to close and re-open the kiCad file every time I add components. Why cant I see the update in real time just like when I add a component manually? I thought KiCad was open-source, but it seems this function that finally adds the components are hidden?

I have spent 25 hours trying to just add the components to the schematic, but I now realize maybe it is not possible to make a function that like high-lights the newly added components in green and asks the user “Do you want to apply these changes?”. Will this feature come out soon?

Many people are working on auto-schematic and auto-placement right now, like flux.ai, DeepPCB, so if KiCad Devs could allow me to call their component-placement functions, I could implement a KiCad extension to make KiCad competitive in the future of auto-schematic and auto-placement algorithms. This could save much of time for new PCB designers.

Does anyone have any idea or thoughts regarding this?

There is no API for schematics in KiCad.

There is only a API for the PCB. And if that is what you are using, it sounds like you are using the deprecated SWIG api and not creating COMMIT objects to add components.

I thought KiCad was open-source, but it seems this function that finally adds the components are hidden?

Open source means you can go to Files · master · KiCad / KiCad Source Code / kicad · GitLab and see the source code. There is nothing hidden.

You could try to leverage GitHub - INTI-CMNB/KiDiff: Tool to generate a PDF file showing the changes between two KiCad PCB/SCH files. Also a git plug-in. to generate a visual diff from your file changes.

The File → Revert action can then be used to load your changes - adding some hooks to do this automatically wouldn’t be hard (but would require a custom compilation of course).