I am trying to write a code to iterate through all texts in a GDS and deliver global coordinates as well as the full path within the GDS hierarchy.
The 1st assignment is easy using the begin_shapes iterator, and it works well.
iter = active_layout.begin_shapes(active_layout.top_cell.cell_index, layer.current.layer_index) # RecursiveShapeIterator
t = iter.shape.text.transformed(iter.itrans) # t is the text transformed into the top cell:
However, once finding a text shape and its global coordinates, I don’t find a way to tell its full path (recall that a single shape can be called from many combinations in the hierarchy path. I want only the single, correct one.)
I also tried to go the other way, writing a recursive function to iterate through the hierarcy tree and locate all texts. That worked, but then, I could not get global transformation easily.
Is there a solution for that?
PS: Using Klayout revision 0.23.1