It looks like you're new here. If you want to get involved, click one of these buttons!
I have not managed to understand how layers are indexed in KLayout. The following code:
# This is the main part of the implementation: create the layout view = pya.Application.instance().main_window().current_view() layout = view.cellview(0).layout() idxs =layout.layer_indexes() li = layout.layer_infos() print("layer indexes:", idxs) print("layer infos", li) for k,l in enumerate(idxs): pts = [pya.Point(k/self.layout.dbu,k/self.layout.dbu), pya.Point((1+k)/self.layout.dbu,k/self.layout.dbu), pya.Point((1+k)/self.layout.dbu,(1+k)/self.layout.dbu)] # create the shape self.cell.shapes(l).insert(pya.Path(pts, 0.5/self.layout.dbu))
layer indexes: [0, 1, 2, 4, 5] layer infos [<pya.LayerInfo object at 0x000000003146b768>, <pya.LayerInfo object at 0x000000003146bcc0>, <pya.LayerInfo object at 0x000000003146ba60>, <pya.LayerInfo object at 0x000000003146bdf0>, <pya.LayerInfo object at 0x000000003146be88>]
But adding a PCell from the code produce the following:
Which is not what I would have expected. Why is there no shape in every layer? And seems the order is not of the layers from layout.layer_indexes().
What am I doing wrong? Thanks