Are you really writting something in the spd file?
Instead the commentary: #read the specific problemtype data file
contents
you must off course use the "puts" tcl command to print your desired
information
set fp [open $filespd r]
puts $fp "hello 1"
puts $fp "hello 2"
close $fp
And off course read it again with "read" or "gets"
set fp [open $filespd r]
set a [read $fp] ;#read all contents
close $fp
You can see the tcl manual at:
http://www.gidhome.com/ManHtml/tcl8.4.9/html/TclCmd/contents.htm
But you don't need to save the information returned by [.central.s info
conditions PointLoad], it's an standard GiD condition.!!
----- Original Message -----
From: "Sofia Costa" ascosta at mec.ua.pt
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, January 24, 2006 11:49 AM
Subject: [GiDlist] Save Problem
Hi GID team!
I've been to try save all assigned data of Condition Point
Load some problems but i did not get success.
My procedures are:
proc SaveGIDProject {filespd} {
set fp [open $filespd w]
if {$fp!=""} {
#save the specific problemtype data file contents...
# global DefaultSearchDirectory
# if { ![info exists DefaultSearchDirectory] || \
# ![file isdirectory $DefaultSearchDirectory]} {
# set DefaultSearchDirectory [pwd]
# }
# set deft $DefaultSearchDirectory
# set aa [.central.s info Project]
# set ProjectName [lindex $aa 1]
# if { [file extension $ProjectName] == ".gid" } {
# set ProjectName [file root $ProjectName]
# }
# if { $ProjectName == "UNNAMED" } {
# tk_dialogRAM .gid.tmpwin error \
# [_ "Before importing, a project title is needed. Save
project to get it"] \
# error 0 OK
# return
# }
# set directory $ProjectName.gid
#WarnWinText "SaveGIDProject $filespd"
# close $fp
set dirinfo [lindex [.central.s info Project] 1]
set rootname [lindex [file split $dirinfo] end]
set from [file join [lindex [.central.s info Project]
1].gid $rootname.flavia.rst]
#set to [file rootname $filespd].flavia.rst
set to [file rootname $filespd].spd
WarnWin "Saving $to from $from"
}
}
proc AfterOpenFile { filename format error} {
WarnWinText "$filename $format $error"
if {$format == "GIDGEOMETRY_FORMAT"} {
set filespd [file join $filename [file tail
$filename]]
if {[file exists $filespd]} {
set fp [open $filespd r]
#read the specific problemtype data file contents
close $fp
}
}
#WarnWinText "LoadGIDProject $filespd"
}
I'm sending you the file of Point load.
When i save the problem type, the file *.spd is a empty
file.
How can i save the information of
[.central.s info conditions PointLoad] ?
Could you give some advice?
Thanks.
[GiDlist] stl-import
Moderator: GiD Team