I am currently struggling with a problem for library cell replacement in a layout.
Let's me expose the problem so that it is clear enough:
I have a gds library called foo and a 2nd one called foo1
in this library i have cells
and in foo1 i have
Now i use this library in a new layout, my layout is like this:
now i want to replace foo.bar1 by foo.bar2 and foo.bar by foo1.bar
in klayout, two ways are provided to replace cells:
the replace cell command and the replace with other. To use replace cell you have to have in your layout the cell with which you want to do the replacement. For this i create an instance, for example foo.bar2 in the layout. then i use the replace cell command. this is not working, klayout telling me "not a valid cell name" whatever i choose from shallow replace to complete replace.
If i use the replace cell with other (ruby script) (for example foo.bar and foo1.bar) things are working better, since all the cells belonging to the selected library are imported in the layout (and the cell is properly replaced if there is a cell with the smae name in the library)
However the library link is lost during the operation (foo1.bar becomes bar, not anymore linked to the library foo1...)which is not that nice.
I tried to implement a new macro based on this replace cell with other but i am struggling at doing a working code !!!
Any help ?