It looks like you're new here. If you want to get involved, click one of these buttons!
import pya
import csv
output_file = "/openlane/work/scripts/output.txt"
gds_files = ["/openlane/work/cliped100.gds"]
KLAYOUT = pya.Layout()
for each_gds in gds_files:
KLAYOUT.read(each_gds)
#print("Cells : ",KLAYOUT.top_cell().name)
#print("Layers : ",KLAYOUT.layers())
#print("each",KLAYOUT.each_cell())
for ly_id in KLAYOUT.layer_indices():
#print ("Layer_info: ",KLAYOUT.get_info(ly_id))
layer_name =KLAYOUT.get_info(ly_id)
print('layer_name:',layer_name)
#sh = KLAYOUT.top_cell().each_shape(0)
# print ("shape area : ", sh)
layer = KLAYOUT.layer(layer_name)
#print(layer)
area = 0
for cell in KLAYOUT.each_cell():
#print(cell)
for shape in cell.each_shape(layer):
area += shape.area()
print(area)
In this i want store all area value in one txt formate document.
anyone know this ?
Comments
@ajaout You can format code in Markdown with a triple backtick line before and after the code (like on GitHub for example).
The problem should be easy to solve if you use Python's methods to write to files, like the ones explained here: https://www.askpython.com/python/built-in-methods/python-print-to-file
Matthias
@ajaout
For python , I can't help you ...but I guess that you can reference for what my code in Ruby.