It looks like you're new here. If you want to get involved, click one of these buttons!
Hello I am a new member, so sorry if I unintentionally violate any discussion rules.
I am trying to produce a png image of a certain region in the layout using python.
1-I need to read the .oas file,
2-Define the region of interest,
3-Create a png image of that region.
I searched through other discussions (https://www.klayout.de/forum/discussion/327/goto-position-and-snapshot)
and I think I can do it by using
include RBA
app = Application.instance
mw = app.main_window
lv = mw.current_view
lv.save_image("image_file.png", 640, 480)
However, when I try to run this on python IDE in Klayout, I receive an error for "include RBA" as an undefined method.
I also tried it on Ruby IDE.
Could you please help me to write a script that will produce a png image of a certain region in the layout using python.
Thanks in advance!
Kind regards.
Comments
Python module is pya. See also sample scripts.
Hello, I am aware of pya. Infact I have been using it in pycharm. However, couldn't find a way to get layout images as png.
Python equivalent of your Ruby code:
I have replied to the other post with a similar answer ...