[GiDlist] (no subject)

Moderator: GiD Team

Post Reply
Andreas Friedberg

[GiDlist] (no subject)

Post by Andreas Friedberg »

Hi everybody,

I am working on the embeddement of a solver called dyn3D (for geotechnical dynamics analysis) into the preprocessor of gid. The solver has three different calculation modules which demand different input data. I have created the configuration files and a tcl-file. When a new project is created within gid ( by choosing the problemtype "dyn3D"), the tcl-file makes a window pop up in which the calculation module can be selected by the user. The selection is stored in a global variable within the tcl procedure and is used in other procedures to specify the menu and the symbols that appear in the gid window. That works fine as long as this global variable is defined. But if I save a project and reopen that project later on, the variable is lost or is set to a standard value. So either the tcl file cannot be interpreted by gid or the wrong values are read.
What I would need to do is to save the global variables values in a file within the project directory so it can be read whenever the project is opened within gid. Does anybody have a clue if that is possible?

Thanks for response, Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030123/67d3e5d9/attachment.htm
Enrique Escolano

[GiDlist] (no subject)

Post by Enrique Escolano »

It exists two tcl procedures called by GiD if the user save or load a model (similar to InitGIDProject)
This procedures are

proc LoadGIDProject { filespd } {
#open the file 'filespd' to read specific problemtype data
}
proc SaveGIDProject { filespd } {
#open the file 'filespd' to save specific problemtype data
}

LoadGIDProject: will be called when a GiD project is loaded. It receives the filespd argument, which is the path of the file which is being opened, but with a .spd extension (specific problemtype data). This path can be useful if you want to write specific information of the problem type in a new file.
for example, if the model is saved in "c:/public/mymodel.gid" then filespd="c:/public/mymodel.gid/mymodel.spd"

SaveGIDProject: will be called when the current opened file is saved to disk. It receives the filespd argument, which is the path of the file which is being saved, but with a .spd extension (specific problemtype data). This path can be useful if you want to write specific information of the problem type in a new file.

Note: If you read a model with a problemtype assigned, then first is called InitGIDProject, and after LoadGIDProject

If you select a new problemtype, then LoadGIDProject is also called, with the parameter filespd set to the problemtype path and .spd extension (for example, in your case filespd="c:/GiD7.2/problemtypes/dyn3D/dyn3D.spd")

Regards
Enrique Escolano

----- Original Message -----
From: Andreas Friedberg
To: GiD mailinglist
Sent: Thursday, January 23, 2003 10:39 PM
Subject: [GiDlist] (no subject)


Hi everybody,

I am working on the embeddement of a solver called dyn3D (for geotechnical dynamics analysis) into the preprocessor of gid. The solver has three different calculation modules which demand different input data. I have created the configuration files and a tcl-file. When a new project is created within gid ( by choosing the problemtype "dyn3D"), the tcl-file makes a window pop up in which the calculation module can be selected by the user. The selection is stored in a global variable within the tcl procedure and is used in other procedures to specify the menu and the symbols that appear in the gid window. That works fine as long as this global variable is defined. But if I save a project and reopen that project later on, the variable is lost or is set to a standard value. So either the tcl file cannot be interpreted by gid or the wrong values are read.
What I would need to do is to save the global variables values in a file within the project directory so it can be read whenever the project is opened within gid. Does anybody have a clue if that is possible?

Thanks for response, Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030124/e972edd2/attachment.htm
Post Reply