607a96d4 |
1 | set aTestName "caf100-A1" |
2 | puts ${aTestName} |
3 | |
4 | # Create a box |
5 | set aSetX1 10 |
6 | set aSetY1 20 |
7 | set aSetZ1 30 |
8 | set aSetDX1 100 |
9 | set aSetDY1 200 |
10 | set aSetDZ1 300 |
11 | |
12 | box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1} |
13 | |
14 | # Create a label |
15 | set aLabel 0:2 |
16 | Label D ${aLabel} |
17 | |
18 | # Close/Open transaction |
19 | NewCommand D |
20 | |
21 | # Set a shape to the label |
22 | SetShape D ${aLabel} aBox1 |
23 | |
24 | # Close/Open transaction |
25 | NewCommand D |
26 | |
27 | # Set a real attribute |
28 | set aRLabel 0:1:1 |
29 | Label D ${aRLabel} |
30 | SetReal D ${aRLabel} 123.456789 |
31 | |
32 | # Set a constraint |
33 | set aCLabel 0:3 |
34 | Label D ${aCLabel} |
35 | SetConstraint D ${aCLabel} "tan" ${aLabel} |
36 | SetConstraint D ${aCLabel} "plane" ${aLabel} |
37 | SetConstraint D ${aCLabel} "value" ${aRLabel} |
38 | |
39 | # Save dump before storing |
40 | set dump_before [GetConstraint D ${aCLabel}] |
41 | puts "dump_before = ${dump_before}" |
42 | |
43 | # Save the document |
44 | set aFile $WorkDirectory/${aTestName}.${FileSuffix} |
45 | |
46 | SaveToFile D $aFile |
47 | |
48 | # Restore the document |
49 | Close D |
50 | Open ${aFile} DD |
51 | |
52 | # Get a shape from the label |
53 | set IsDone [catch {GetConstraint DD ${aCLabel}} aResult] |
54 | if { ${IsDone} != 0 } { |
55 | puts "Error : Get a value of TDataStd_Constraint attribute from restoring document" |
56 | } else { |
57 | puts "aResult = ${aResult}" |
58 | |
59 | # Save dump after retrieving |
60 | set dump_after [GetConstraint DD ${aCLabel}] |
61 | puts "dump_after = ${dump_after}" |
62 | |
63 | if { ${dump_before} != ${dump_after} } { |
64 | puts "dump_after = ${dump_after} while dump_before = ${dump_before}" |
65 | puts "Error : Get a value of TDataStd_Constraint attribute from restoring document" |
66 | } |
67 | } |