| 68 | return [ layout.get_info(layer), shape.box.width() * layout.dbu, shape.box.height() * layout.dbu ] |
| 69 | |
| 70 | class PCellTestLib(pya.Library): |
| 71 | |
| 72 | def __init__(self): |
| 73 | |
| 74 | # set the description |
| 75 | self.description = "PCell test lib" |
| 76 | |
| 77 | # create the PCell declarations |
| 78 | self.layout().register_pcell("Box", BoxPCell()) |
| 79 | |
| 80 | sb_index = self.layout().add_cell("StaticBox") |
| 81 | l10 = self.layout().insert_layer(pya.LayerInfo(10, 0)) |
| 82 | sb_cell = self.layout().cell(sb_index) |
| 83 | sb_cell.shapes(l10).insert(pya.Box(0, 0, 100, 200)) |
| 84 | |
| 85 | # register us with the name "PCellTestLib" |
| 86 | self.register("PCellTestLib") |
| 87 | |
| 88 | |
| 89 | if "PCellDeclarationHelper" in pya.__dict__: |