61c421bf |
1 | puts "================" |
2 | puts "OCC2932" |
3 | puts "================" |
4 | puts "" |
5 | ####################################################################################### |
6 | # Create Attribute Delta depending on actual change of the attribute |
7 | ####################################################################################### |
8 | # Case 1 (TDataStd_Axis) |
9 | ####################################################################################### |
10 | |
11 | # Create a new document and set UndoLimit |
e837410d |
12 | NewDocument D BinOcaf |
61c421bf |
13 | UndoLimit D 100 |
14 | |
15 | # Create a label and set attributes |
16 | NewCommand D |
17 | set Label 0:2 |
18 | |
19 | ############################################ |
20 | set X 10 |
21 | set Y 20 |
22 | set Z 30 |
23 | set DX 100 |
24 | set DY 200 |
25 | set DZ 300 |
26 | line Line ${X} ${Y} ${Z} ${DX} ${DY} ${DZ} |
27 | ############################################ |
28 | |
29 | set Real1 300. |
30 | set Real2 400. |
31 | set modified_attribute TDataStd_Real |
32 | |
33 | ############################################ |
34 | # Set TDataStd_Axis |
35 | SetAxis D ${Label} Line |
36 | ############################################ |
37 | |
38 | SetReal D ${Label} ${Real1} |
39 | set list [DumpCommand D] |
40 | |
41 | # Open a transaction |
42 | NewCommand D |
43 | set list [DumpCommand D] |
44 | |
45 | ############################################ |
46 | # Set old value for TDataStd_Axis |
47 | SetAxis D ${Label} Line |
48 | ############################################ |
49 | |
50 | # Set new value for TDataStd_Real |
51 | SetReal D ${Label} ${Real2} |
52 | set list [DumpCommand D] |
53 | |
54 | # Open a transaction |
55 | NewCommand D |
56 | set list [DumpCommand D] |
57 | |
58 | # Checking |
59 | set ll [llength ${list}] |
60 | set good_length 17 |
61 | puts "length = ${ll}" |
62 | puts "good_length = ${good_length}" |
63 | |
64 | if { ${ll} != ${good_length} } { |
65 | puts "OCC2932 Error (case 1)" |
66 | } else { |
67 | set name_attribute [lindex ${list} [expr ${good_length} - 1]] |
68 | puts "name_attribute = ${name_attribute}" |
69 | puts "modified_attribute = ${modified_attribute}" |
70 | if {[string compare ${name_attribute} ${modified_attribute}] == 0} { |
71 | puts "OCC2932 OK" |
72 | } else { |
73 | puts "OCC2932 Error (case 2)" |
74 | } |
75 | } |