2 puts "================"
4 puts "================"
9 # Testing attribute: TDataStd_Axis
11 # Testing command: SetAxis
12 # Testing command: GetAxis
15 # ANALOG: puts "caf001-H3"
17 # Create a new document and set UndoLimit
18 NewDocument Doc BinOcaf
26 # Add an attribute to a data framework
33 line aLine1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
35 set aDumpLine1 [dump aLine1]
37 # [llength ${aDumpLine1}] = 14
38 # Format of ${aDumpLine1}:
39 # *********** Dump of aLine1 *************
42 # Axis :0.267261241912424, 0.534522483824849, 0.801783725737273
44 set anOriginX_Line1 [lindex [split [lindex ${aDumpLine1} 7] ${aTokList}] 1]
45 set anOriginY_Line1 [lindex [split [lindex ${aDumpLine1} 8] ${aTokList}] 0]
46 set anOriginZ_Line1 [lindex [split [lindex ${aDumpLine1} 9] ${aTokList}] 0]
47 set anAxisDX_Line1 [lindex [split [lindex ${aDumpLine1} 11] ${aTokList}] 1]
48 set anAxisDY_Line1 [lindex [split [lindex ${aDumpLine1} 12] ${aTokList}] 0]
49 set anAxisDZ_Line1 [lindex [split [lindex ${aDumpLine1} 13] ${aTokList}] 0]
52 SetAxis Doc ${aLabel} aLine1
54 # Close/Open the transaction
58 set aFile ${imagedir}/OCC1228-${casename}.cbf
60 catch {SaveAs Doc ${aFile}}
61 if { ![file exists ${aFile}] } {
62 puts "There is not ${aFile} file; SaveAs command: Error"
63 puts "OCC1228: ERROR (case 1)"
65 #catch {exec chmod 777 ${aFile}}
67 # Restore the document
69 catch {Open ${aFile} DDoc}
71 # Get a value of the attribute
72 set IsDone [catch {GetAxis DDoc ${aLabel} anAxis3} aResult]
73 if { ${IsDone} != 0 } {
75 puts "Get a value of TDataStd_Axis attribute from restoring document: Error"
76 puts "OCC1228: ERROR (case 2)"
79 set aDumpAxis3 [dump anAxis3]
80 set anOriginX_Axis3 [lindex [split [lindex ${aDumpAxis3} 7] ${aTokList}] 1]
81 set anOriginY_Axis3 [lindex [split [lindex ${aDumpAxis3} 8] ${aTokList}] 0]
82 set anOriginZ_Axis3 [lindex [split [lindex ${aDumpAxis3} 9] ${aTokList}] 0]
83 set anAxisDX_Axis3 [lindex [split [lindex ${aDumpAxis3} 11] ${aTokList}] 1]
84 set anAxisDY_Axis3 [lindex [split [lindex ${aDumpAxis3} 12] ${aTokList}] 0]
85 set anAxisDZ_Axis3 [lindex [split [lindex ${aDumpAxis3} 13] ${aTokList}] 0]
87 if { ${anOriginX_Line1} != ${anOriginX_Axis3} ||
88 ${anOriginY_Line1} != ${anOriginY_Axis3} ||
89 ${anOriginZ_Line1} != ${anOriginZ_Axis3} ||
90 ${anAxisDX_Line1} != ${anAxisDX_Axis3} ||
91 ${anAxisDY_Line1} != ${anAxisDY_Axis3} ||
92 ${anAxisDZ_Line1} != ${anAxisDZ_Axis3} } {
93 puts "anOriginX_Line1=${anOriginX_Line1} anOriginX_Axis3=${anOriginX_Axis3}"
94 puts "anOriginY_Line1=${anOriginY_Line1} anOriginY_Axis3=${anOriginY_Axis3}"
95 puts "anOriginZ_Line1=${anOriginZ_Line1} anOriginZ_Axis3=${anOriginZ_Axis3}"
96 puts "anAxisDX_Line1=${anAxisDX_Line1} anAxisDX_Axis3=${anAxisDX_Axis3}"
97 puts "anAxisDY_Line1=${anAxisDY_Line1} anAxisDY_Axis3=${anAxisDY_Axis3}"
98 puts "anAxisDZ_Line1=${anAxisDZ_Line1} anAxisDZ_Axis3=${anAxisDZ_Axis3}"
99 puts "Get a value of TDataStd_Axis attribute from restoring document: Error"
100 puts "OCC1228: ERROR (case 2)"
102 puts "Get a value of TDataStd_Axis attribute from restoring document: OK"