5f07d05d |
1 | puts "========" |
2 | puts "OCC26216" |
3 | puts "========" |
4 | puts "" |
5 | ####################################################################### |
6 | # Convert compound to assembly |
7 | ####################################################################### |
8 | |
9 | pload ALL |
10 | |
11 | box b1 0 0 0 10 10 10 |
12 | box b2 0 0 0 10 10 10 |
13 | box b3 0 0 0 10 10 10 |
14 | compound b1 b2 b3 c |
15 | |
16 | XNewDoc D |
17 | XAddShape D c 0 |
18 | explode c |
19 | XSetColor D c_1 1 0 0 |
20 | XSetColor D c_2 0 1 0 |
21 | XSetColor D c_3 0 0 1 |
22 | XExpand D c |
23 | |
24 | if { [regexp "ASSEMBLY COMPOUND 0:1:1:1 \"COMPOUND\"" [Xdump D]] != 1 } { |
25 | puts "ERROR: Structure of document is wrong." |
26 | } else { |
27 | if { [regexp "RED" [XGetShapeColor D 0:1:1:2]] != 1 } { |
28 | puts "ERROR: Structure of document is wrong." |
29 | } else { |
30 | if { [regexp "GREEN" [XGetShapeColor D 0:1:1:3]] != 1 } { |
31 | puts "ERROR: Structure of document is wrong." |
32 | } else { |
aaf8d6a9 |
33 | if { [regexp "BLUE" [XGetShapeColor D 0:1:1:4]] != 1 } { |
5f07d05d |
34 | puts "ERROR: Structure of document is wrong." |
35 | } |
36 | } |
37 | } |
38 | } |
39 | |
40 | |
41 | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |