It looks like you're new here. If you want to get involved, click one of these buttons!
Hello, I am trying to write a script which will have an input of layer name and a cell name, then I want it to return all cOordinates of boxes within the given layer and given cell.
Does anyone have any suggestions from where to start?
For instance I can get all coordinates of boxes for a given cell by using
my_layout_query=pya.LayoutQuery.new("select cell.name, path_trans * cell.bbox, path_trans.disp.x, path_trans.disp.y from instances of ...*")
cell_to_iterate='bar'
for q in my_layout_query.each(layout): #iterate with cell names
box_info=q.data()
if box_info[0]==cell_to_iterate:
print(box_info[0])
However I am not sure how to get the box/shape coordinates for a specific layer.
Thank you! I really appreciate your help!.
Comments
I think I found the answer. Hope this helps to any other people who need to do the same task. It is really nice that you can even do it for multiple layers simultaneously! This will give you the absolute coordinates of each shape for a given cell and given layer or layers
Hi,
thanks for sharing this solution!
The code is correct, I just think you wanted to use "box_in_cell" in the following expression like this:
Regards,
Matthias