It looks like you're new here. If you want to get involved, click one of these buttons!
Looking for an python example of how to iterate through all the contacts (in layer 15/0) in a given region (let's say from 1000,1000 to 2000,2000).
Already spent two days on that but no success yet.
here is a sample which prints the contacts. It uses a "recursive shape iterator" to capture contacts from child cells too. They need to be transformed to top level if you want them to appear is seen from top.
ly = pya.CellView.active().layout()
box = pya.Box(1000, 1000, 2000, 2000)
l15 = ly.layer(15, 0)
iter = ly.top_cell().begin_shapes_rec_overlapping(l15, box)
while not iter.at_end():
contact = iter.shape().polygon.transformed(iter.trans())
Thanks, much appreciated