It looks like you're new here. If you want to get involved, click one of these buttons!
I want to make cell and all the shape within a area , that like this value...
x1=-9500.000001000
x2=7000.000001000
y1=-146000.000001000
y2=-144200.000001000
How can I do in Ruby code?
I have some idea as below...
But it is not workable....
main_window = RBA::Application::instance.main_window
layout = RBA::CellView::active.layout
layout_view = main_window.current_view
layoutView = RBA::Application::instance.main_window.current_view.active_cellview.cell
x1=-9500.00000*1000
x2=7000.00000*1000
y1=-146000.00000*1000
y2=-144200.00000*1000
iter = layoutView.begin_instances_rec_overlapping(RBA::Box::new(x1, y1, x2, y2))
while !iter.at_end
###get all the cell in the area.
####move these cell into a special cell.
iter.next
iter = layoutView.each_shape
while !iter.at_end
###get all the shape in the area.
####move these cell into a special cell.
iter.next
end ##while
Comments
I am sorry, I do not fully understand.
So you want a clip of all shapes inside that area? There is a specific method for that: Layout#clip
Matthias
Hi Matthias,
checked with the notice of clip , look like it is what I need , but could you please pass me a sample?
as below , I want to make all the pattern within the bbox area into a cell , and make it named "CELL_IO".
in the document , I saw the description of clip , but I can't get the point for how to using that....
Description: Clips the given cell by the given rectangle and produce a new cell with the clip
cell:
The cell index of the cell to clip
box:
The clip box in database units
Returns:
The index of the new cell
Here is some code I found in an older discussion. It produces a clip from the rectangle -1mm, -1mm to +1mm, +1mm (for database unit 0.001µm). Please note that the rectangle coordinates must be given in database units:
Matthias
Hi Matthias,
Thanks a lot , I will try it.
Hi Matthas,
After check , clip should not what the function I need , or maybe I have some miss for the script.
As below , I using begin_shapes_rec_overlapping... to get what the pattern in special layer and where the place in the BBox.
that is what the step1 ,
in step 2 , I want to make these pattern and make it named "pattern".
but....Look like I still need your help to learn how to process the pattern "pattern_item".
#
in this code , the function is what I want to do....
I can copy all the shape (in layer 154,1) , change layer and copy pattern int cell.
but I can't choose the pattern by BBox area...
This is a DRC script, isn't it? This is a DRC statement:
If you're in DRC, why not just doing:
?