It looks like you're new here. If you want to get involved, click one of these buttons!
Hello Matthias:
Somehow I lost my top cell after I run below code, not sure the " each_shape " function will erase the cell where it exist ? or I missed something important ?
layout = pya.Application.instance().main_window().current_view().active_cellview().layout()
top = pya.Application.instance().main_window().current_view().active_cellview().cell
pin = layout.layer(95, 0)
label = top.each_shape(pin) <-----
Thanks for your reply always
Comments
No, each shape will not erase anything. But the code is lacking the body of the loop. It should look like
Matthias
Hello Matthias, Thank a lot.
Hello Matthias :
Below is a simple code to centralize the text in box, but I still lost my top cell and text after running. I just made it write a new GDS file to cover temporary. Would you give me some idea when free? Thank you ~
First, "layout" is a variable which is not assigned anything. I think you want to say
Second, the first loop just iterates over the pins and labels in the same loop. I think you want to have two separate loops for collecting pins and labels. This is a simple version using array comprehension:
Third, you can iterate over the arrays themselves, drop the "else" (with the "None" which is simply nonsense) and simplify the inside check:
Matthias
Hello Matthias,
Wow.. this updated code is amazing to me !! Can't not wait to use this skill to other script.
Somehow, after running the updated code, I still lost my top cell. I think re-location the shape coordinate
pin.text_dpos = pad.dbbox().center()
already means " ... do something with "shape" .. " , but it's OK to re-write a new GDS to cover it, not too much time , thanks a lot
Could you explain what you mean by "lost my top cell"? It's still there - the code does not change that. And when I tried the code I still see the top cell and it's still active.
Matthias
Hello Matthias,
Maybe it is due to my own computer's problem, please have below 3 pictures,
a) Picture-1 : use box 100 x 200 um to test
b) Picture-2 : top cell is disappear after running below code
c) Picture-3 : choose both text & box by mouse dragging, found the text already be centralized,
I found after the code run, just save file and re-open it, everything will be normal, thanks
Thanks for the images.
This is weird. The cell must be there still, but I don't know why it is not displayed. I have not seen an effect like this before.
What Windows version are you using?
Matthias
Hmmm..... Windows 7 " professional " SP1 , maybe it is time to upgrade..
Vincent
Oh well, maybe
I'm not aware of any compatibility issues, but maybe it's a graphic driver thing or similar. I guess only the cell name isn't painted. Data is still there.
Matthias
Got it with thanks
Vincent