pload DEFAULT
pload DCAF
if [info exists Doc] {Close Doc; unset Doc}
if [info exists D] {Close D; unset D}
# Create a new document and set UndoLimit
NewDocument Doc BinOcaf
UndoLimit Doc 100

# Open a transaction
NewCommand Doc

puts "Create beziercurve"
beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10
mkedge E2 cc
set aLabel2 0:2
Label Doc ${aLabel2}
SetShape Doc ${aLabel2} E2
NewCommand Doc

puts "Create bsplinecurve"
bsplinecurve bc 2 3 0 3 1 1 2 3 10 0 7 1 7 0 7 1 3 0 8 1 0 0 7 1
mkedge E3 bc
set aLabel3 0:3
Label Doc ${aLabel3}
SetShape Doc ${aLabel3} E3
NewCommand Doc

puts "Create beziersurf - 8"
beziersurf s 3 4 \
0 0 0 10 0 5 20 0 0 \
0 10 2 10 10 3 20 10 2 \
0 20 10 10 20 20 20 20 10 \
0 30 0 10 30 0 20 30 0
mkface F4 s
set aLabel4 0:4
Label Doc ${aLabel4}
SetShape Doc ${aLabel4} F4
NewCommand Doc

puts "Create bsplinesurf - 9"
bsplinesurf bs \
1 2 0 2 1 2 \
2 3 0 3 1 1 2 3 \
0 0 0 1 10 0 5 1 \
0 10 2 1 10 10 3 1 \
0 20 10 1 10 20 20 1 \
0 30 0 1 10 30 0 1
mkface F5 bs
set aLabel5 0:5
Label Doc ${aLabel5}
SetShape Doc ${aLabel5} F5
NewCommand Doc

puts "Create revsurf - 7"
circle c 50 0 0 20
revsurf rs c 0 0 0 0 1 0
mkshell SH6 rs
set aLabel6 0:6
Label Doc ${aLabel6}
SetShape Doc ${aLabel6} SH6
NewCommand Doc

puts "Create an elliptic cylinder - 6 (extrusion)"
ellipse e 0 0 0 10 5
extsurf exs e 0 0 1
trimv exs exs 0 10
mkface F7 exs
set aLabel7 0:7
Label Doc ${aLabel7}
SetShape Doc ${aLabel7} F7


puts "==> SaveAs Doc"
#DFBrowser Doc
SaveAs Doc /dn05/KAS/dev/SZY-Bin/work/TA96.cbf

Close Doc
unset Doc
puts "==> Open Doc"
Open /dn05/KAS/dev/SZY-Bin/work/TA96.cbf D

smallview
puts "==> Extract & display shapes"
GetShape D 0:2 S2
GetShape D 0:3 S3
GetShape D 0:4 S4
GetShape D 0:5 S5
GetShape D 0:6 S6
GetShape D 0:7 S7

don S7
fit
wait 2
don S5
wait 2
don S4
wait 2
don S3
wait 2
don S2
wait 2
don S6
wait 2
display S2 S3 S4 S5 S6 S7
fit
puts "Info: TEST COMPLETED"
