It looks like you're new here. If you want to get involved, click one of these buttons!
Hello,
I can list all cells from a GDS but can't find a way to access all cell instances in a layout. All examples I've seen are about creating a new instance of a cell and insert it but I can't find how to access all the instances using the Python API... I understood this should be related to CellInstArray and Instance objects but can't find the missing link
Thank you for your help
Ronan
Comments
Hi,
Maybe this method is the one you are searching for.
I recently used it in
fishfinder.py
at this link.Hi,
Thank you. I was able to get further by using the each_parent_inst method. But I'm still struggling to extract the information I'm looking for (for each instance, I would like to get its position and rotation).
If I print the object, I can see the data I'm after but can't find which field contains the actual information. The vars() / dict does not seem to be implemented as for standard Python objects.
This is the code I'm using (using the gds from the fishfinder example)
I get output like this
so I see the coordinates and rotation when printing the object . I guess this is because of a proper implementation of str or repr for the object. But vars() return an empty dict... which puzzles me...
Hi,
I think you have almost done it.
I have modified your code, as shown below.
Then, I got the outputs:
The child cell
Show only the top cell and the child cell.
Go to the reference point of idx=0.
Go to the reference point of idx=138.
Thank you very much. That was all I needed to continue my script. Do you have an explanation why vars() is not working ?
@nanor000,
These are Python-wrapped C++ objects. They do not feature a dict slot. Hence no "vars".
Matthias