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