Equivalent of Deep Copy in Python Macro Design

Hi Matthias,

What is the proper way of copying a cell so that it does not share the same instance with the other one?

Thank you.

Comments

  • Hi,

    The method is "Cell#copy_tree":

    ly = ... # a pya.Layout
    new_cell = ly.create_cell("NEW_CELL")
    new_cell.copy_tree(ly.cell("ORIGINAL_CELL"))
    

    This will create a copy of "ORIGINAL_CELL" in "NEW_CELL" with all the subcells duplicated.

    Matthias

  • Thanks Matthias. It worked well!

Sign In or Register to comment.