It looks like you're new here. If you want to get involved, click one of these buttons!
I'm trying to delete all shapes belong to a specific layer within only non-top cells, i.e. all the cells referred by top cells.
I find reference in this forum about how to perform some operations within all cells, such as
layout = pya.CellView.active().layout() for cell in layout.each_cell() cell.clear(layer1)
But I don't know how to tell if the cell is a non-top cell that I want to perform this operation to.
Thank you for your help!
Comments
@Andy Actually that is very simple: a top cell is one without parents, so you need to check if "parent_cells" is not zero:
For large layouts, it may be more efficient to first collect all cells you want to treat and then clear the layer on these cells. The reason is that "parent_cells" is a computed property and "clear" will make the layout modified. This will trigger re-computation on every parent_cells call.
Matthias
Matthias, Thank you! It works as intended!