40093367 |
1 | #INTERFACE CAF |
2 | # XLink attributes |
3 | # |
4 | # Testing attribute: TDocStd_XLink |
5 | # |
6 | # Testing command: Copy |
7 | # |
8 | |
9 | puts "caf004-A1" |
10 | |
11 | # Create two new documents Doc1, Doc2 |
e837410d |
12 | NewDocument Doc1 BinOcaf |
13 | NewDocument Doc2 BinOcaf |
40093367 |
14 | |
15 | # Set UndoLimit for them |
16 | UndoLimit Doc1 100 |
17 | UndoLimit Doc2 100 |
18 | |
19 | # Set a shape in Doc1 to label 'SLabel' |
20 | set aLabel1 0:2 |
21 | Label Doc1 ${aLabel1} |
22 | SetName Doc1 ${aLabel1} SLabel |
23 | |
24 | set aSetX1 10 |
25 | set aSetY1 20 |
26 | set aSetZ1 30 |
27 | set aSetDX1 100 |
28 | set aSetDY1 200 |
29 | set aSetDZ1 300 |
30 | |
31 | box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1} |
32 | |
1f26f80b |
33 | bounding aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1 |
40093367 |
34 | |
35 | SetShape Doc1 ${aLabel1} aBox1 |
36 | |
37 | # Create a new label 'TLabel1' in Doc1 |
38 | set aLabel2 0:3 |
39 | Label Doc1 ${aLabel2} |
40 | SetName Doc1 ${aLabel2} TLabel1 |
41 | |
42 | # Open transaction in Doc1 |
43 | NewCommand Doc1 |
44 | |
45 | # Copy 'SLabel' to the label 'TLabel1' without link |
46 | Copy Doc1 ${aLabel2} Doc1 ${aLabel1} |
47 | |
48 | # Close/Open transaction |
49 | NewCommand Doc1 |
50 | |
51 | # Undo Doc1 |
52 | Undo Doc1 |
53 | |
54 | # Redo Doc1 |
55 | Redo Doc1 |
56 | |
57 | # Get a shape from 'TLabel1' |
58 | GetShape Doc1 ${aLabel2} aBox2 |
59 | |
1f26f80b |
60 | bounding aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2 |
1a0339b4 |
61 | |
62 | if { [dval X1_Box1] != [dval X1_Box2] || |
63 | [dval Y1_Box1] != [dval Y1_Box2] || |
64 | [dval Z1_Box1] != [dval Z1_Box2] || |
65 | [dval X2_Box1] != [dval X2_Box2] || |
66 | [dval Y2_Box1] != [dval Y2_Box2] || |
67 | [dval Z2_Box1] != [dval Z2_Box2] } { |
68 | puts "X1_Box1=[dval X1_Box1] X1_Box2=[dval X1_Box2]" |
69 | puts "Y1_Box1=[dval Y1_Box1] Y1_Box2=[dval Y1_Box2]" |
70 | puts "Z1_Box1=[dval Z1_Box1] Z1_Box2=[dval Z1_Box2]" |
71 | puts "X2_Box1=[dval X2_Box1] X2_Box2=[dval X2_Box2]" |
72 | puts "Y2_Box1=[dval Y2_Box1] Y2_Box2=[dval Y2_Box2]" |
73 | puts "Z2_Box1=[dval Z2_Box1] Z2_Box2=[dval Z2_Box2]" |
40093367 |
74 | puts "Copy attributes of the same document: Error" |
75 | return |
76 | } |
77 | |
78 | puts "Copy attributes of the same document: OK" |