1 set aTestName "caf004-B3"
4 # Create two new documents Doc1, Doc2
5 set FileFormat "BinOcaf"
6 if { $FileSuffix == "xml" } {
7 set FileFormat "XmlOcaf"
9 NewDocument Doc1 $FileFormat
10 NewDocument Doc2 $FileFormat
12 # Set UndoLimit for them
16 # Set a shape in Doc1 to label 'SLabel'
19 SetName Doc1 ${aLabel1} SLabel
28 box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
30 bounding -s aBox1 -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
32 SetShape Doc1 ${aLabel1} aBox1
34 # Create a new label 'TLabel1' in Doc1
37 SetName Doc1 ${aLabel2} TLabel1
39 # Open transaction in Doc1
42 # Copy 'SLabel' to the label 'TLabel1' with link
43 CopyWithLink Doc1 ${aLabel2} Doc1 ${aLabel1}
45 # Close/Open transaction
49 set aFile $WorkDirectory/${aTestName}.${FileSuffix}
51 SaveToFile Doc1 $aFile
53 # Restore the document
57 # Get a shape from 'TLabel1' of restoring document
58 set IsDone [catch {GetShape Doc2 ${aLabel2} aBox2} aResult]
59 if { ${IsDone} != 0 } {
60 puts "Error : Get a value of TNaming_NamedShape attribute from restoring document"
62 bounding -s aBox2 -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
64 if { [dval X1_Box1] != [dval X1_Box2] ||
65 [dval Y1_Box1] != [dval Y1_Box2] ||
66 [dval Z1_Box1] != [dval Z1_Box2] ||
67 [dval X2_Box1] != [dval X2_Box2] ||
68 [dval Y2_Box1] != [dval Y2_Box2] ||
69 [dval Z2_Box1] != [dval Z2_Box2] } {
70 puts "X1_Box1=[dval X1_Box1] X1_Box2=[dval X1_Box2]"
71 puts "Y1_Box1=[dval Y1_Box1] Y1_Box2=[dval Y1_Box2]"
72 puts "Z1_Box1=[dval Z1_Box1] Z1_Box2=[dval Z1_Box2]"
73 puts "X2_Box1=[dval X2_Box1] X2_Box2=[dval X2_Box2]"
74 puts "Y2_Box1=[dval Y2_Box1] Y2_Box2=[dval Y2_Box2]"
75 puts "Z2_Box1=[dval Z2_Box1] Z2_Box2=[dval Z2_Box2]"
76 puts "Error : Get a link between attributes of the same document from restoring document"