It looks like you're new here. If you want to get involved, click one of these buttons!
With the Klayout python module I'm struggling to receive the x,y coordinates of a selected Instance of a cell in a wafer map.
selectedCell = next(pya.LayoutView.current().each_object_selected())
cell_id = selectedCell .cell_index()
bbox = layout.cell(cell_id).bbox()
Would this be the correct way to receive the x,y ?
Main target is to replace a selected instance with one from a gds file.
Thanks and best regards,
Andy
Comments
Hi Andy,
I think you can do all of that in a single step. I'd recommend to open the GDS file with the substitution cell and copy/paste it into your wafer map layout first. Then the task is to substitute each selected instance with this cell. You can use this script for this purpose (edit "cell_to_use_instead" to specify the new cell's name):
Regards,
Matthias
Hello Matthias,
thanks for your feedback. Your solution worked very well but I decided finally to use the X,Y coordinates. Reason is that I need a solution where I could store the values into a config file. For the program I use for viewing and direct editing klayout and your klayout python package to manage the data.
I'd like to thank you for providing klayout - there is no request we can't overcome by using the programming API. Thanks for all the effort to put such a great tool together.
Here my solution I worked out:
``
``
You're welcome
Thanks for sharing your code.
Matthias