40093367 |
1 | #INTERFACE CAF |
2 | # NamedShape |
3 | # |
4 | # Testing attribute: TNaming_NamedShape |
5 | # |
6 | # Testing command: NewShape |
7 | # |
8 | |
9 | puts "caf002-B1" |
10 | |
11 | # Create a box |
12 | set aSetX1 10 |
13 | set aSetY1 20 |
14 | set aSetZ1 30 |
15 | set aSetDX1 100 |
16 | set aSetDY1 200 |
17 | set aSetDZ1 300 |
18 | |
19 | box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1} |
20 | |
21 | set aBoundingBox1 [bounding aBox1] |
22 | set X1_Box1 [lindex ${aBoundingBox1} 0] |
23 | set Y1_Box1 [lindex ${aBoundingBox1} 1] |
24 | set Z1_Box1 [lindex ${aBoundingBox1} 2] |
25 | set X2_Box1 [lindex ${aBoundingBox1} 3] |
26 | set Y2_Box1 [lindex ${aBoundingBox1} 4] |
27 | set Z2_Box1 [lindex ${aBoundingBox1} 5] |
28 | |
29 | # Create a label |
30 | set aLabel 0:2 |
31 | Label D ${aLabel} |
32 | |
33 | # Close/Open transaction |
34 | NewCommand D |
35 | |
36 | # Set a shape to the label |
37 | NewShape D ${aLabel} aBox1 |
38 | |
39 | # Close/Open transaction |
40 | NewCommand D |
41 | |
42 | # Undo |
43 | Undo D |
44 | |
45 | # Get a shape from the label |
46 | catch {GetShape D ${aLabel} aBox2} |
47 | |
48 | # Redo |
49 | Redo D |
50 | |
51 | # Get a shape from the label |
52 | GetShape D ${aLabel} aBox3 |
53 | |
54 | set aBoundingBox3 [bounding aBox3] |
55 | set X1_Box3 [lindex ${aBoundingBox3} 0] |
56 | set Y1_Box3 [lindex ${aBoundingBox3} 1] |
57 | set Z1_Box3 [lindex ${aBoundingBox3} 2] |
58 | set X2_Box3 [lindex ${aBoundingBox3} 3] |
59 | set Y2_Box3 [lindex ${aBoundingBox3} 4] |
60 | set Z2_Box3 [lindex ${aBoundingBox3} 5] |
61 | |
62 | if { ${X1_Box1} != ${X1_Box3} || |
63 | ${Y1_Box1} != ${Y1_Box3} || |
64 | ${Z1_Box1} != ${Z1_Box3} || |
65 | ${X2_Box1} != ${X2_Box3} || |
66 | ${Y2_Box1} != ${Y2_Box3} || |
67 | ${Z2_Box1} != ${Z2_Box3} || |
68 | [info exists aBox2] } { |
69 | puts "X1_Box1=${X1_Box1} X1_Box3=${X1_Box3}" |
70 | puts "Y1_Box1=${Y1_Box1} Y1_Box3=${Y1_Box3}" |
71 | puts "Z1_Box1=${Z1_Box1} Z1_Box3=${Z1_Box3}" |
72 | puts "X2_Box1=${X2_Box1} X2_Box3=${X2_Box3}" |
73 | puts "Y2_Box1=${Y2_Box1} Y2_Box3=${Y2_Box3}" |
74 | puts "Z2_Box1=${Z2_Box1} Z2_Box3=${Z2_Box3}" |
75 | puts "NewShape command: Error" |
76 | return |
77 | } |
78 | |
79 | puts "NewShape command: OK" |