2 puts "================"
4 puts "================"
9 # Testing attribute: TDataStd_Shape
11 # Testing command: SetShape
12 # Testing command: GetShape
15 # ANALOG: puts "caf001-K3"
17 # Create a new document and set UndoLimit
18 NewDocument Doc BinOcaf
24 # Add an attribute to a data framework
32 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
34 bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
37 SetShape Doc ${aLabel} aBox1
39 # Close/Open the transaction
43 set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf
45 catch {SaveAs Doc ${aFile}}
46 if { ![file exists ${aFile}] } {
47 puts "There is not ${aFile} file; SaveAs command: Error"
48 puts "OCC1228: ERROR (case 1)"
50 #catch {exec chmod 777 ${aFile}}
52 # Restore the document
54 catch {Open ${aFile} DDoc}
56 # Get a value of the attribute
57 set IsDone [catch {GetShape DDoc ${aLabel} aBox5} aResult]
58 if { ${IsDone} != 0 } {
60 puts "Get a value of TDataStd_Shape attribute from restoring document: Error"
61 puts "OCC1228: ERROR (case 2)"
64 bounding -s aBox5 -save X1_Box5 Y1_Box5 Z1_Box5 X2_Box5 Y2_Box5 Z2_Box5
66 if { [dval X1_Box1] != [dval X1_Box5] ||
67 [dval Y1_Box1] != [dval Y1_Box5] ||
68 [dval Z1_Box1] != [dval Z1_Box5] ||
69 [dval X2_Box1] != [dval X2_Box5] ||
70 [dval Y2_Box1] != [dval Y2_Box5] ||
71 [dval Z2_Box1] != [dval Z2_Box5] } {
72 puts "X1_Box1=[dval X1_Box1] X1_Box5=[dval X1_Box5]"
73 puts "Y1_Box1=[dval Y1_Box1] Y1_Box5=[dval Y1_Box5]"
74 puts "Z1_Box1=[dval Z1_Box1] Z1_Box5=[dval Z1_Box5]"
75 puts "X2_Box1=[dval X2_Box1] X2_Box5=[dval X2_Box5]"
76 puts "Y2_Box1=[dval Y2_Box1] Y2_Box5=[dval Y2_Box5]"
77 puts "Z2_Box1=[dval Z2_Box1] Z2_Box5=[dval Z2_Box5]"
78 puts "Get a value of TDataStd_Shape attribute from restoring document: Error"
79 puts "OCC1228: ERROR (case 3)"
81 puts "Get a value of TDataStd_Shape attribute from restoring document: OK"