Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

python script to get the coordinate value of each cell for one gds file

Hi, recently I am doing some python codes for the klayout, now I know how to get all the cell names from one gds file by using python. I am thinking, is there possible to get all the cell positions (such as coordinate value) from one gds file by using python? hope some one can have some ideas or codes can do that.




  • Hi Muheng,

    the solution depends on your requirements.

    If you're interested in the cell instances below the top cell, this code will print the cell names and their transformations (rotation/mirror + coordinate):

    layout =
    for inst in layout.top_cell().each_inst():
      print("Cell " + layout.cell(inst.cell_index).name + ": " + str(inst.trans))


  • Hi, Matthias, thanks a lot, I will try in my klayout

Sign In or Register to comment.