heitzmann / gdspy

Python module for creating GDSII stream files, usually CAD layouts.
Boost Software License 1.0
348 stars 126 forks source link

'Cell' object has no attribute 'elements' #223

Closed CongjiangCST closed 1 year ago

CongjiangCST commented 1 year ago

When I ran my code:

filepath = './test.gds'
gdsii = gdspy.GdsLibrary()
gdsii.read_gds(filepath)
cell = gdsii.top_level()[0]
print(len(cell.elements))

I got an error: AttributeError: 'Cell' object has no attribute 'elements' My environment is python3.7.4 and gdspy 1.6.12. Can anyone give me some advice to solve it? Thanks.

heitzmann commented 1 year ago

@CongjiangCST Cell objects don't have elements, they have name, polygons, paths, labels, and references. Please take a look at the documentation.