Home › Forums › Nazca › Identify Cells already created › Reply To: Identify Cells already created
5 June 2019 at 13:58
#5552
Ronald
Keymaster
Dear Daneel,
Using the @hashme decorator should work for you as discussed in this topic
import nazca as nd
@nd.bb_util.hashme('rectangle', 'length', 'width') # gives default cell name 'rectangle_80_80'
def rectangles(length=80, width=80):
with nd.Cell(hashme=True) as rectangle:
rect = geom.box(length=length, width=width)
nd.Polygon(points=rect).put(0, 0)
return rectangle
In case you still want to know which cells have been defined you can try the following code to print all cell names:
import nazca as nd
for name in nd.cfg.cellnames.keys():
print(name)
Ronald