Python import GDS file's

So I am using the following code I came up with the import GDS files,
it uses a GUI to select the files ..
All works well the first time ,
but when you run the script again ,
to select new cells .
it loads the previous cells as well.
issue seems to be with the tc = layout.top_cells()

for cell in gdsFiles: tc = layout.top_cells() for cell in tc: #we don't want to insert the topcell itself if ( != "TOP"): print('New Cell generated: '' in Hierarchy ' trans = pya.CplxTrans( 1.0, ang, flip, x, y),trans) print(trans) layout.cell(top_cell_idx).insert(new_instance) x = x + step


  • This is weird. Basically after you have inserted the cell instances, "layout.top_cells" should give you only a single cell.

    You can print the number of top cells after the loop to verify this.

    You should also check if:

    • "topcell" is really the top cell
    • "gdsFiles" is not containing the old files too
    • "top_cell_idx" is the same than "topcell.cell_index()"


  • edited May 3

    I have done this above as a debug.
    There is some Ruby code in the fourms that does a similar thing .
    it's not an issue just something I noticed

Sign In or Register to comment.