4 # Testing attribute: TDocStd_XLink
6 # Testing command: CopyWithLink
11 # Create two new documents Doc1, Doc2
12 NewDocument Doc1 BinOcaf
13 NewDocument Doc2 BinOcaf
15 # Set UndoLimit for them
19 # Set a shape in Doc1 to label 'SLabel'
22 SetName Doc1 ${aLabel1} SLabel
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]
41 SetShape Doc1 ${aLabel1} aBox1
43 # Create a new label 'TLabel1' in Doc1
46 SetName Doc1 ${aLabel2} TLabel1
48 # Open transaction in Doc1
51 # Copy 'SLabel' to the label 'TLabel1' with link
52 CopyWithLink Doc1 ${aLabel2} Doc1 ${aLabel1}
54 # Close/Open transaction
58 set aFile ${imagedir}/caf004-B3.cbf
61 if { ![file exists ${aFile}] } {
62 puts "There is not ${aFile} file; SaveAs command: Error"
65 #catch {exec chmod 777 ${aFile}}
67 # Restore the document
71 # Get a shape from 'TLabel1' of restoring document
72 set IsDone [catch {GetShape Doc2 ${aLabel2} aBox2} aResult]
73 if { ${IsDone} != 0 } {
75 puts "Get a value of TNaming_NamedShape attribute from restoring document: Error"
79 set aBoundingBox2 [bounding aBox2]
80 set X1_Box2 [lindex ${aBoundingBox2} 0]
81 set Y1_Box2 [lindex ${aBoundingBox2} 1]
82 set Z1_Box2 [lindex ${aBoundingBox2} 2]
83 set X2_Box2 [lindex ${aBoundingBox2} 3]
84 set Y2_Box2 [lindex ${aBoundingBox2} 4]
85 set Z2_Box2 [lindex ${aBoundingBox2} 5]
87 if { ${X1_Box1} != ${X1_Box2} ||
88 ${Y1_Box1} != ${Y1_Box2} ||
89 ${Z1_Box1} != ${Z1_Box2} ||
90 ${X2_Box1} != ${X2_Box2} ||
91 ${Y2_Box1} != ${Y2_Box2} ||
92 ${Z2_Box1} != ${Z2_Box2} } {
93 puts "X1_Box1=${X1_Box1} Y1_Box1=${Y1_Box1} Z1_Box1=${Z1_Box1} X2_Box1=${X2_Box1} Y2_Box1=${Y2_Box1} Z2_Box1=${Z2_Box1}"
94 puts "X1_Box2=${X1_Box2} Y1_Box2=${Y1_Box2} Z1_Box2=${Z1_Box2} X2_Box2=${X2_Box2} Y2_Box2=${Y2_Box2} Z2_Box2=${Z2_Box2}"
95 puts "Get a link between attributes of the same document from restoring document: Error"
99 puts "Get a link between attributes of the same document from restoring document: OK"