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.

thanks

Muheng

Comments

  • 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 = pya.CellView.active().layout()
    
    for inst in layout.top_cell().each_inst():
      print("Cell " + layout.cell(inst.cell_index).name + ": " + str(inst.trans))
    

    Matthias

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

Sign In or Register to comment.