Home › Forums › Nazca › export cells into an existing gds › Reply To: export cells into an existing gds
Dear Paul,
As an example on how to add a cell to a gds I take a small detour. First load the gds as a “library” in Nazca:
LIB = nd.load_gds(asdict=True)
Due to asdict=True the load_gds() returns a dictionary where the keys are the cell names and the values are the Cells. By default only top cells are expressed as the keys in dict LIB, but this can be changed to include all cells as keys:
LIB = nd.load_gds(filename=, asdict=True, topcellsonly=False
Hence, if you have a gds “test.gds” with top cells named “A” and “B”, you can load and place them like this:
LIB = nd.load_gds(filename="test.gds", asdict=True)
LIB['A'].put()
LIB['B'].put()
The default pin of the library cells (here LIB[‘A’], LIB[‘B’]) is set to the ‘org’ pin.
You can load and export the original gds in the following way:
LIB = nd.load_gds(filename=, asdict=True)
cell_list = list(LIB.values())
nd.export_gds(cell_list)
You can add extra cells to cell_list before calling nd.export_gds.
Does that cover your use case?
Ronald