2 puts "================"
4 puts "================"
9 # Testing attribute: TNaming_NamedShape
11 # Testing command: GetShape
14 # ANALOG: puts "caf002-C1"
16 # Create a new document and set UndoLimit
17 NewDocument Doc BinOcaf
31 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
33 set aBoundingBox1 [bounding aBox1]
34 set X1_Box1 [lindex ${aBoundingBox1} 0]
35 set Y1_Box1 [lindex ${aBoundingBox1} 1]
36 set Z1_Box1 [lindex ${aBoundingBox1} 2]
37 set X2_Box1 [lindex ${aBoundingBox1} 3]
38 set Y2_Box1 [lindex ${aBoundingBox1} 4]
39 set Z2_Box1 [lindex ${aBoundingBox1} 5]
45 # Close/Open transaction
48 # Set a shape to the label
49 SetShape Doc ${aLabel} aBox1
51 # Close/Open transaction
55 set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf
57 catch {SaveAs Doc ${aFile}}
58 #catch {exec chmod 777 ${aFile}}
59 if { ![file exists ${aFile}] } {
60 puts "There is not ${aFile} file; SaveAs command: Error"
61 puts "OCC1228: ERROR (case 1)"
64 # Restore the document
66 catch {Open ${aFile} DDoc}
68 # Get a shape from the label
69 set IsDone [catch {GetShape DDoc ${aLabel} aBox3} aResult]
70 if { ${IsDone} != 0 } {
72 puts "Get a value of TNaming_NamedShape attribute from restoring document: Error"
73 puts "OCC1228: ERROR (case 2)"
76 catch {set aBoundingBox3 [bounding aBox3]}
83 catch {set X1_Box3 [lindex ${aBoundingBox3} 0]}
84 catch {set Y1_Box3 [lindex ${aBoundingBox3} 1]}
85 catch {set Z1_Box3 [lindex ${aBoundingBox3} 2]}
86 catch {set X2_Box3 [lindex ${aBoundingBox3} 3]}
87 catch {set Y2_Box3 [lindex ${aBoundingBox3} 4]}
88 catch {set Z2_Box3 [lindex ${aBoundingBox3} 5]}
90 if { ${X1_Box1} != ${X1_Box3} ||
91 ${Y1_Box1} != ${Y1_Box3} ||
92 ${Z1_Box1} != ${Z1_Box3} ||
93 ${X2_Box1} != ${X2_Box3} ||
94 ${Y2_Box1} != ${Y2_Box3} ||
95 ${Z2_Box1} != ${Z2_Box3} } {
96 puts "X1_Box1=${X1_Box1} X1_Box3=${X1_Box3}"
97 puts "Y1_Box1=${Y1_Box1} Y1_Box3=${Y1_Box3}"
98 puts "Z1_Box1=${Z1_Box1} Z1_Box3=${Z1_Box3}"
99 puts "X2_Box1=${X2_Box1} X2_Box3=${X2_Box3}"
100 puts "Y2_Box1=${Y2_Box1} Y2_Box3=${Y2_Box3}"
101 puts "Z2_Box1=${Z2_Box1} Z2_Box3=${Z2_Box3}"
102 puts "Get a value of TNaming_NamedShape attribute from restoring document: Error"
103 puts "OCC1228: ERROR (case 3)"
105 puts "Get a value of TNaming_NamedShape attribute from restoring document: OK"