forked from huangqiangsheng/Ruby_mask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselection_duplication_move.rb
More file actions
40 lines (33 loc) · 1023 Bytes
/
selection_duplication_move.rb
File metadata and controls
40 lines (33 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Enter your Ruby code here
include RBA
app = Application.instance
mw = app.main_window
lv = mw.current_view
if lv == nil
raise "Shape Statistics: No view selected"
end
paths = 0
polygons = 0
boxes = 0
texts = 0
dbu = CellView::active.layout.dbu
lv.each_object_selected do |sel|
p1 = DPoint::new(0,1050/dbu)
p2 = DPoint::new(0,-250/dbu)
p3 = DPoint::new(0,-2450/dbu)
p4 = DPoint::new(0,-250/dbu)
shape = sel.shape
dup_shape1 = shape.dup
shape.shapes.insert(dup_shape1)
dup_shape1.transform(CplxTrans::new(1,0,false,p1))
dup_shape2 = dup_shape1.dup
shape.shapes.insert(dup_shape2)
dup_shape2.transform(CplxTrans::new(1,0,false,p2))
dup_shape3 = dup_shape2.dup
shape.shapes.insert(dup_shape3)
dup_shape3.transform(CplxTrans::new(1,0,false,p3))
dup_shape4 = dup_shape3.dup
shape.shapes.insert(dup_shape4)
dup_shape4.transform(CplxTrans::new(1,0,false,p4))
end
# MessageBox::info("Shape Statistics", s, MessageBox::Ok)