Hi, Matthias!
Below is log of my KLayout build with added output (method name, stage + LayputView title) from layMainWindow methods. Somehow title is reverted back to original form after change in Python. I'll try to add more logging to catch updat…
Hi, Matthias!
We debug Python code in our application only in script mode, so GUI is not initialized.
You could create wrapper for KLayout that would behave like Python (this would also solve possible conflicting switches), but KLayout still need …
Hi, Matthias!
Weird, but it didn't work for me :/ I tried standard 0.26.10 and our own 0.26.4 builds on Ubuntu 18 with sessions with one and for layouts.
Could logging help to drill into source of problem?
Hi, Matthias!
VS Code run python module that establish connection between IDE and Python process. This is why I wrote about VS Code requirements to Python (or pseudo-Python application). -c is needed to extract Python version and platform (VS Code …
I'm not aware about design intent, but it'll be good idea to treat path in command-line parameters and internally constructed ones in same way. Currently former is taken in raw form without converting to URI when later are converted to URI.
Hi, Matthias!
I tried your code in command line situation: klayout -rm <configuration> -u <session> and it doesn't work :-(. First call to on_file_open show empty title, callback one - doesn't affect tabs.
Same problem happens when session is restored in GUI or relative path is used, i. e. KLayout started from path with + sign and relative path in command line doesn't contain it.
Hi, Matthias!
Visual Studio Code allows to specify Python interpreter, so we make our application to behave like Python (supporting -c command-line option to return version information and module execution to run VS Code Python debugger), so it's p…
Hi, Vandhana!
layer parameter is index that could be found with Layout.find_layer(). There are several variants of latter that allow to specify layer and datatype.
Layout.begin_shapes() returns RecursiveShapeIterator object that has shape property. See Shape documentation to learn how to access polygon properties.
Hi!
You could access polygons from Layout.begin_shapes(). Current layout object is accessible from CellView.active().layout(). See also scripting documentation.
Hi!
No, you just monitor selection changes in event handler assigned to LayoutView.on_selection_changed, so you don't need to care about low-level mouse events.
Python code looks like:
import pyamain_window = pya.Application.instance().main_windo…
Hi, Francesco!
See example script linked in my first answer. LayoutView is accessed with RBA::Application::instance.main_window.current_view. See also scripting documentation.
Hi!
You could install event handler on LayoutView.on_selection_changed and do some additional processing. Main window menu command may be installed in .lym file and it may enable/disable event handler functionality.
Hi, Florent!
You could access layer properties using LayoutView.begin_layers() that returns iterator. Then <iterator>.current().visible (of LayerProperties type) allows to control visibility.
For example (sorry for Python-centrism):
it = cu…
Hi, Matthias!
Thank you for help!
As workaround I use early return from current_view.each_object_selected() loop in on_selection_changed handler when object is selected, and code handling no objects selected situation is located after loop.
Eugen…
Hi, Matthias!
I tried 0.26.9 and I was not correct in original problem description. LayoutView.on_selection_changed is called when object(s) is/are unselected, but LayoutView.has_object_selection is still True
Test code:
import pyamain_window = p…
Hi, Dean!
If commercial tool could suit your needs, you may be interested to look at ParagonX. Tool is extractor-agnostic and provides much more analyses then voltage/current density maps.
Disclaimer: I work for company that created ParagonX.
Hi!
Looks like you could handle MainWindow.on_view_created event. Alternatively you could create macro that will ask user for file name with QFileDialog, call MainWindow.load_layout and perform other customizations.
Eugene.
Hi, Ege!
I think LayoutView.save_layer_props is what are you looking for. If you need to do this for single layer, you should find needed one by iterating starting from LayoutView.begin_layers. See LayerProperties and LayerPropertiesIterator. tf_im…
Hi, Matthias!
Thank you for suggestion! Actually my real code use show() (modal dialog could not be moved on Ubuntu). What is right place to call _destroy() in this case?
Eugene.