It looks like you're new here. If you want to get involved, click one of these buttons!
What's the best way to create a layout procedurally?
What I want to do is essentially instantiating cells in other cells without directly having a (top cell) layout object (yet). I want to first create leaf cells in individual modules and then have a top cell instantiate the cells and add references.
But the problem I noticed is that if I create a cell e.g. with
c = pya.Cell() the layout object of the cell is (understandably) not instantiated. Is there a way to a) make the layout object of the cell a valid instantiated object and then b) once I have the actual parent cell instantiated, i.e. something like
parent_cell.copy_tree(child_cell) without each cell having their individual layout object and then repeating
child_cell = layout.create_cell(chil_cell_name) and then use copy tree in the parent cell after creating the empty child cell there?
To make it easier to understand I would like to do the following
### Module of leaf cell leaf_cell = pya.Cell() # Do something with the cell here, e.g. add and transform shapes
### Module of parent cell from leaf_cell import leaf_cell parent_cell = pya.Cell() # instantiate a leaf_cell in parent_cell with something like parent_cell.copy_tree(leaf_cell) here
As far as I can tell this doesn't work because neither parent_cell nor child_cell have a valid layout object because they weren't created through