40093367 |
1 | #INTERFACE CAF |
2 | # |
3 | #Sometimes this error is inside a log file, but it is outside in other case. The '?' character manage it. |
4 | # |
5 | puts "================" |
6 | puts "OCC1228" |
7 | puts "================" |
8 | puts "" |
9 | |
10 | # Presentation attributes |
11 | # |
12 | # Testing attribute: TPrsStd_AISPresentation |
13 | # |
14 | # Testing command: AISSet |
15 | # |
16 | |
17 | # ANALOG: puts "caf003-A4" |
18 | |
19 | # Create a new document and set UndoLimit |
20 | NewDocument Doc BinOcaf |
21 | UndoLimit Doc 100 |
22 | |
23 | # Open a transaction |
24 | NewCommand Doc |
25 | |
26 | # Set NamedShape attribute |
27 | box aBox1 100 200 300 |
28 | set aLabel 0:2 |
29 | SetShape Doc ${aLabel} aBox1 |
30 | |
31 | # Initialize 3D viewer |
32 | AISInitViewer Doc |
33 | |
34 | # Add AISPresentation attribute with parameter NS |
35 | AISSet Doc ${aLabel} NS |
36 | |
37 | # Display presentation of NamedShape in the viewer |
38 | AISDisplay Doc ${aLabel} |
39 | |
40 | # Save the document |
8418c617 |
41 | set aFile ${imagedir}/OCC1228-[file tail [info script]].cbf |
40093367 |
42 | file delete ${aFile} |
43 | catch {SaveAs Doc ${aFile}} |
44 | if { ![file exists ${aFile}] } { |
45 | puts "There is not ${aFile} file; SaveAs command: Error" |
46 | puts "OCC1228: ERROR (case 1)" |
47 | } |
48 | #catch {exec chmod 777 ${aFile}} |
49 | |
50 | # Restore the document |
51 | Close Doc |
52 | catch {Open ${aFile} DDoc} |
53 | |
54 | # Initialize 3D viewer |
55 | catch {AISInitViewer DDoc} |
56 | |
57 | ########## Add AISPresentation attribute with parameter NS |
58 | ##########AISSet DDoc ${aLabel} NS |
59 | |
60 | # Display presentation of NamedShape in the viewer |
61 | set IsDone [catch {AISDisplay DDoc ${aLabel}} aResult] |
62 | if { ${IsDone} != 0 } { |
63 | puts ${aResult} |
64 | puts "Get a value of TPrsStd_AISPresentation attribute from restoring document: Error" |
65 | puts "OCC1228: ERROR (case 2)" |
66 | } else { |
24de79c3 |
67 | Close DDoc |
40093367 |
68 | puts "There is the box in the viewer" |
69 | puts "OCC1228: OK" |
70 | } |