Hi Matthias,
Is there a sample ruby code that describe how to do the action "Goto Position" and then "Snapshot / Screenshot to a PNG file" just like in window mode ?
We hope to get the layout screen with multiple coordinates in batch mode however have no idea how to do that, could you please give us a hint ? thank you so much~
Best Regards,
--
chhung
Comments
Hi chhung,
this is code which does that:
Please replace the values by yours. I hope the code is documented well enough, so you're able to adapt it to your needs.
Regards,
Matthias
Hi Matthias,
I tried to run the RBA code and it responsed the error:
And is it possible to run the code in non-GUI mode ?
Best Regards,
chhung
Hi,
Sorry, it should say "DBox". I edited the code.
You can run "klayout -z ..." with the script, but not with -zz. In the latter mode there is no view object and KLayout is a pure layout processor without any graphics.
Regards,
Matthias
Hi Matthias,
I tried the new code and it works fine~
Thank you so much~
Best Regards,
chhung
I have a question about the batch sanpshot.
Ex, there are total 10 layers of the gds (1/0,2/0,3/0,4/0, ....,10/0),
I only want to show 1/0, 3/0 and 10/0 layers of the images.
How could I do that with this batch code?
Thank you.
Regards,
Canny
Hi Canny,
the easiest solution is to prepare a .lyp file with the layer properties (colors, stipples, styles and
the layers you want to show) and load the layer properties:
Regards,
Matthias
Thanks a lot, it does save lot of time of mine.
Regards,
Canny
I have another question, when I use the above script
# script start
mw = RBA::Application::instance.main_window
mw.load_layout(input_file, 0)
view = mw.current_view
#--script end
It always shows the top cell of the input file.
If I want to assign coordinates are according to the other cell of the input file.
How could I modify the script?
Thank you.
Regards,
Canny
Hi Canny,
you mean "how to show another cell"? You can do that this way (in this example the name of the cell to show is "MY_CELL":
Matthias
Yes, it is what I need.
Thank you.
Regards,
Canny
I want to add a function that goes to a specific location within the gdsii/oasis and create a view with a specific magnification. Then I want to take a snapshot such that the pixel width/height is identical if I then perform another goto position/mag and take another screendump. I want to do that repeatedly throughout the gdsii. I tried to find an analog to the display-goto-position (CTRL-G) but cannot find it yet.
Thanks,
Chris
Chris,
Here is some code that reproduces display-goto-position (Ctrl-G) with minor changes. I wrote it before I knew that display-goto-position existed
Hopefully you can modify for your purposes, e.g. it sounds like you need to put it in a loop of some kind, and you need to add the screenshot function (there are examples on klayout.de to do that).
When you have a finished code, please share it here.
Thanks,
David
Thanks very much again, David!
Plus here is the line for writing the screenshot:
Matthias
Can we do this in pure script mode (-zz) without GUI ?
Thanks
Hi klfun,
no, you can't (currently). The drawing feature is too tighly connected to the Windowing system.
You can however run any program headless with a dummy display using "Xvfb":
Regards,
Matthias
regarding David's script above.
I think two lines can be changed as below