I think you will need to explain more, about what this
text format should contain / look like. Are you asking
simply for a list of the layers used, or some text export
of all the polygons on one (or all) layers, and would
that be a full list-of-vertices-and-layer-for-each, ....
I agree - you should be a bit more specific about what you want to achieve.
If you're just looking for the layers that are used inside your GDS file, this script sketch may give you some first idea:
# if you want to run as a standalone script, use this initialization:
# ly = pya.Layout()
# ly.read(input)
# and run KLayout with "klayout -b -r thisscript.py -rd input=yourfile.gds
# Take the currently loaded layout:
ly = pya.CellView.active().layout()
# Print the layers inside the layout object
# TODO: sorting, filtering non-GDS layers etc.
for l in ly.layer_infos():
print(str(l))
Dear Matthias,
Thanks, it works, sure will be more specific to my questions. May I know if is there any documentation for the Python Klayout scripting, the module documentation for the usage of commands, and example scripting to have some reference?
Rgds
KumaranS
Comments
I think you will need to explain more, about what this
text format should contain / look like. Are you asking
simply for a list of the layers used, or some text export
of all the polygons on one (or all) layers, and would
that be a full list-of-vertices-and-layer-for-each, ....
I agree - you should be a bit more specific about what you want to achieve.
If you're just looking for the layers that are used inside your GDS file, this script sketch may give you some first idea:
Matthias
Dear Matthias,
Thanks, it works, sure will be more specific to my questions. May I know if is there any documentation for the Python Klayout scripting, the module documentation for the usage of commands, and example scripting to have some reference?
Rgds
KumaranS
Hi, Kumaran!
See https://www.klayout.de/doc-qt5/programming/index.html and https://www.klayout.de/doc-qt5/code/index.html.
You could find a lot of examples on this forum.