Command restore corrected to set default name of the shape equal to filename without extension
Test case added (demo draw restore)
help save {save variable [filename]} "DRAW Variables management"
proc restore {file {name ""}} {
- if {$name == ""} {set name $file}
+ if {$name == ""} {
+ # if name is not given explicitly, use name of the file w/o extension
+ set name [file rootname [file tail $file]]
+ }
global Draw_DataDir
uplevel #0 "brestore [file join $Draw_DataDir $file ] $name"
return $name
--- /dev/null
+# check that restore command defines default name for the loaded shape
+# as base name of the file without extension
+
+restore [locate_data_file CCV-POUR-COPIER-COLLER.brep]
+
+if { ! [regexp {is a shape} [whatis CCV-POUR-COPIER-COLLER]] } {
+ puts "Error: no shape with name CCV-POUR-COPIER-COLLER after restore"
+}
+
+puts "TEST COMPLETED"