Hi, Matthias,
I gds files whihc top cell are all 10 um x 10 um and cell original points are at left down corner.
The vias(0/0) with size 0.04 um x 0.04 um are randomly on whole top cell.
I want to delete the contacnt out of region 1st corner (4,4) and second corner(6,6).
If it is possible do it with rba code?
Thank you.
Regards,
Canny
Comments
Hi Canny,
Here's a sketch:
Please note that this will work only in editor mode. In viewer mode, it is not allowed to erase a shape while iterating them.
Regards,
Matthias
I tried the above sketch, but I can't make it work.
I have 2 questions,
1. how do you get the layer index?
I wrote the command as l=RBA::LayerInfo.new(0,0)
Is it correct?
2. I still use klayout 0.21.19, when I execute the rba script, the system always feedback
Ruby error: 'undefined method `shapes' for 70:Fixnum' (NoMethodError)
The following is the script I tried, thank you.
layout = RBA::Layout.new
layout.read("test.gds")
lay=RBA::LayerInfo.new(0,0)
c=layout.cell_by_name("CLIPPED_test")
shape = c.shapes(lay)
region1 = RBA::Box::new(3908.645, 1169.02, 3912.125, 1173.75)
shape.each_touching(region1) do |s|
shape.erase(s)
end
layout.write("test_novia.gds")
Regards,
Canny
Hi Canny,
Version 0.21.19 is quite old. But that is not the reason for the error message. In "cell_by_name" will give you the cell index, not the cell object. To get the cell object from the index, you'll have to use "layout.cell(cell_index)".
You can get the layer index by searching for the requested layer in the list of present layers. This is done like this:
Matthias