It looks like you're new here. If you want to get involved, click one of these buttons!
Hi Matthias,
Is it possible to invoke the Instance GUI (menu Edit | Mode | Instance) from a script? As an argument to the function call, I would like to 1) set the Cell and Library, 2) then query the list of PCell parameters, then 3) pass some PCell parameters to the GUI. Then via function, click "Apply" or "Ok", so that the GUI disappears, but the mouse is in the mode of showing the cell to be instantiated.
Thank you
Lukas
Comments
Hi Lukas,
sorry for the delayed response. The feature you ask for is not available out of the box, but it can be emulated (sorry, Ruby - but the Python transformation should be straightforward):
The last statements are somewhat questionable as they rely on the widget hierarchy, but as long as there is no major UI update, this should work.
Best regards,
Matthias
Thank you Matthias.
This is very helpful, and useful for implementing schematic driven layout:
Are there any ways of querying the to-be-instantiated cell, e.g., location, rotation, etc?
Is there a way to create a call back for when the to-be-instantiated cell moves or changes otherwise?
The goal is to create fly lines.
Alternatively:
thank you
Hi Lukas,
there are no callbacks for the editor functions such as "create instance" or "create polygon". Changing the behavior there is C++ domain.
It is possible however to implement new editor functions. Such as "place cell with fly lines". The key for doing so is the Plugin API (https://www.klayout.de/doc-qt5/programming/application_api.html#k_11). This allows implementing entirely new tools that take full control over the mouse. These tools plug themselves into the tool bar as new tools.
However that will basically means reimplementing the cell placement feature. KLayout doesn't really have an open architecture where you can plug in and replace things as you like. That is owned to the static nature of the C++ core. And opening too many callbacks only induces side effects that are very hard to control.
Matthias
thank you.