It looks like you're new here. If you want to get involved, click one of these buttons!
Hi Matthias and everyone,
I'd like to share KLayout-klink, an open-source external control layer for a running KLayout GUI, and ask for some feedback on its KLayout API coverage. (https://github.com/klinkdev2026/klayout-klink)
While developing it, I found some older discussions on this forum about controlling an already-running KLayout instance from an external application. In particular, Matthias suggested using socket-based IPC while keeping KLayout itself as the host application.
https://www.klayout.de/forum/discussion/254/call-reload-from-command-line?utm_source=chatgpt.com
klink essentially follows this direction, but tries to turn the task-specific socket "glue code" into a reusable control interface.
Rather than simply providing a remote eval, I went through the KLayout pya and GUI APIs and tried to organize the operations useful for external control into stable, typed APIs.
Currently, the KLayout-facing control surface mainly covers:
.lypFor things that are not yet covered, exec.python remains an escape hatch to the native pya API.
My own layout background is mainly custom research devices and nanodevices. Although I have tried to systematically go through the KLayout APIs, I do not know all the important workflows in IC layout, mask preparation, MEMS, photonics, PDK-based design and other fields.
So my main question is:
Which KLayout APIs or concepts am I still missing that you think are important enough to deserve a stable external control API?
I do not intend to wrap every pya method individually. I am mainly trying to identify the common, high-value operations that are useful when KLayout is controlled by an external Python program, automation system or MCP/AI client.
Matthias, I would especially appreciate your opinion, since you have seen KLayout used across many more application domains than I have.
Any suggestions or criticism would be very welcome.
Best regards,
Yanming