[GiDlist] Save the Problem Type

An embedded and charset-unspecified text was scrubbed…
Name: not available
Url: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060105/591ee231/attachment.txt
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060105/591ee231/attachment.htm

GiD can only save the standard associated data: materials, conditions, general data.
If your problemtype has its own data (in tcl variables) then must be saved/read to disk using its own file.
I order to do this, when the user save/read a model, GiD provides a call to a Tcl procedure that the problemtype can
implement to save this additional information.

The event procedures are:(read GiD help about Tcl-Tk extension - event procedures)

proc SaveGIDProject { filespd } {
set fp [open $filespd w]
if { $fp != “” } {
#read the file contents …
close $fp
}
}
a.. 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.

proc AfterOpenFile { filename format error } {
…body…
}

a.. AfterOpenFile: will be called after a geometry or mesh file is read or imported inside GiD. It receives as arguments:
a.. filename: the full name of the readed file.
b.. format: ACIS_FORMAT, DXF_FORMAT, GID_BATCH_FORMAT, GID_GEOMETRY_FORMAT, GID_MESH_FORMAT , IGES_FORMAT, NASTRAN_FORMAT,PARASOLID_FORMAT,SHAPEFILE_FORMAT,STL_FORMAT or VDA_FORMAT
c.. error: boolean 0 or 1 to indicate an error when reading.
proc SaveGIDProject { filespd } {
set fp [open $filespd w]
if { $fp != “” } {
#save the specific problemtype data file contents …
close $fp
}
}

proc AfterOpenFile { filename format error } {
WarnWinText “$filename $format $error”
if { $format == “GID_GEOMETRY_FORMAT” } {
#open and read the additional file contents.
#the name of the file to open can be obtained from filename, e.g.
set filespd [file join $filename [file tail $filename].spd]
if { [file exists $filespd } {
set fp [open $filespd r]
#read the specific problemtype data file contents …
close $fp
}
}
}

Instead AfterOpenFile, it’s also possible to use the procedure LoadGIDProject , but note that this event is called when reading a model, but also when reading a problemtype (because it is like a special model). It’s more recommended to use AfterOpenFile.
proc LoadGIDProject { filespd } {
…body…
}
----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gid.cimne.upc.es
Sent: Thursday, January 05, 2006 4:10 PM
Subject: [GiDlist] Save the Problem Type


Hi!

I save my problem type, for example like teste.gid.
When i close the program and i open teste.gid, all values saved and assigned don’t appear.
What’s appening? There is any procedure to save that values before close problem type?


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060109/80b6319e/attachment.htm

An embedded and charset-unspecified text was scrubbed…
Name: not available
Url: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060110/b69a5557/attachment.txt
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060110/b69a5557/attachment.htm

This is because the Nastran problemtype only need to save with the model the “standard data” (conditions, materials, etc), and this is responsability of GiD to save the applied values.

For example, a GiD condition is a list of QUESTION - VALUE fields.
The question is stored in the condition definition itself *.cnd, and the different values applied to entities of the model are stored by GiD in a binary file named *.lin. But probably you are using other additional values stored in your own tcl variables (instead to fill a VALUE field), then is your responsability to save and restore this data when GiD save an read the model.

Enrique

----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gid.cimne.upc.es
Sent: Tuesday, January 10, 2006 4:36 PM
Subject: Re: [GiDlist] Save the Problem Type


But in Nastran this procedures aren’t used.
How all information are saved?

Thanks.



GiD can only save the standard associated data: materials, conditions, general data.
If your problemtype has its own data (in tcl variables) then must be saved/read to disk using its own file.
I order to do this, when the user save/read a model, GiD provides a call to a Tcl procedure that the problemtype can
implement to save this additional information.

The event procedures are:(read GiD help about Tcl-Tk extension - event procedures)

proc SaveGIDProject { filespd } {
set fp [open $filespd w]
if { $fp != “” } {
#read the file contents …
close $fp
}
}
a.. 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.

proc AfterOpenFile { filename format error } {
…body…
}

a.. AfterOpenFile: will be called after a geometry or mesh file is read or imported inside GiD. It receives as arguments:
a.. filename: the full name of the readed file.
b.. format: ACIS_FORMAT, DXF_FORMAT, GID_BATCH_FORMAT, GID_GEOMETRY_FORMAT, GID_MESH_FORMAT , IGES_FORMAT, NASTRAN_FORMAT,PARASOLID_FORMAT,SHAPEFILE_FORMAT,STL_FORMAT or VDA_FORMAT
c.. error: boolean 0 or 1 to indicate an error when reading.
proc SaveGIDProject { filespd } {
set fp [open $filespd w]
if { $fp != “” } {
#save the specific problemtype data file contents …
close $fp
}
}

proc AfterOpenFile { filename format error } {
WarnWinText “$filename $format $error”
if { $format == “GID_GEOMETRY_FORMAT” } {
#open and read the additional file contents.
#the name of the file to open can be obtained from filename, e.g.
set filespd [file join $filename [file tail $filename].spd]
if { [file exists $filespd } {
set fp [open $filespd r]
#read the specific problemtype data file contents …
close $fp
}
}
}

Instead AfterOpenFile, it’s also possible to use the procedure LoadGIDProject , but note that this event is called when reading a model, but also when reading a problemtype (because it is like a special model). It’s more recommended to use AfterOpenFile.
proc LoadGIDProject { filespd } {
…body…
}
----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gid.cimne.upc.es
Sent: Thursday, January 05, 2006 4:10 PM
Subject: [GiDlist] Save the Problem Type


Hi!

I save my problem type, for example like teste.gid.
When i close the program and i open teste.gid, all values saved and assigned don’t appear.
What’s appening? There is any procedure to save that values before close problem type?


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060110/6a5f7292/attachment.htm

An embedded and charset-unspecified text was scrubbed…
Name: not available
Url: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060111/a2eef1fb/attachment.txt
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060111/a2eef1fb/attachment.htm

An embedded and charset-unspecified text was scrubbed…
Name: not available
Url: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060118/8b9112f7/attachment.txt
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060118/8b9112f7/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed…
Name: faceload.tcl
Type: application/octet-stream
Size: 28932 bytes
Desc: not available
Url : http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060118/8b9112f7/attachment.obj

GiD saves all the condition VALUE values applied to entities. In your condition this fields are “Face ID”, Pressure, Face
(for example, Face ID=1 Pressure=25 Face=Face_Load for the line 56, etc)

Warning: you must not use space characters for a question, condition or book name, instead “Face ID”, must use Face_ID !!!

But you additionally use tkwidget to add more Tk features to the standard conditions windows.
You used some tablelist, etc. This widgets are under your control, GiD don’t know nothing about its contents, and is your responsability to save to/read from disk this values in your own files (when GiD raise the event of save/read the model)

Enrique
----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gid.cimne.upc.es
Sent: Wednesday, January 18, 2006 11:14 AM
Subject: {SPAM?} Re: [GiDlist] Save the Problem Type


Hi!

But if i have in my *.cnd for example

BOOK: Face Load
NUMBER: 2 CONDITION: FaceLoad
CONDTYPE: over surfaces
CONDMESHTYPE: over elements
QUESTION: Face ID:
VALUE: 1
STATE: hidden
QUESTION: Pressure:
VALUE: 100.0
STATE: hidden
QUESTION: Face:
VALUE: Face_Load
STATE: hidden
TKWIDGET: faceload::ComunicateWithGiD
END CONDITION

How can i save this values that are asigned to points and all information introduced in one tablelist.
I’m sending you faceload.tcl.

What i have to write in SaveGIDProject ?

Thanks.




This is because the Nastran problemtype only need to save with the model the “standard data” (conditions, materials, etc), and this is responsability of GiD to save the applied values.

For example, a GiD condition is a list of QUESTION - VALUE fields.
The question is stored in the condition definition itself *.cnd, and the different values applied to entities of the model are stored by GiD in a binary file named *.lin. But probably you are using other additional values stored in your own tcl variables (instead to fill a VALUE field), then is your responsability to save and restore this data when GiD save an read the model.

Enrique

----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gid.cimne.upc.es
Sent: Tuesday, January 10, 2006 4:36 PM
Subject: Re: [GiDlist] Save the Problem Type


But in Nastran this procedures aren’t used.
How all information are saved?

Thanks.



GiD can only save the standard associated data: materials, conditions, general data.
If your problemtype has its own data (in tcl variables) then must be saved/read to disk using its own file.
I order to do this, when the user save/read a model, GiD provides a call to a Tcl procedure that the problemtype can
implement to save this additional information.

The event procedures are:(read GiD help about Tcl-Tk extension - event procedures)

proc SaveGIDProject { filespd } {
set fp [open $filespd w]
if { $fp != “” } {
#read the file contents …
close $fp
}
}
a.. 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.

proc AfterOpenFile { filename format error } {
…body…
}

a.. AfterOpenFile: will be called after a geometry or mesh file is read or imported inside GiD. It receives as arguments:
a.. filename: the full name of the readed file.
b.. format: ACIS_FORMAT, DXF_FORMAT, GID_BATCH_FORMAT, GID_GEOMETRY_FORMAT, GID_MESH_FORMAT , IGES_FORMAT, NASTRAN_FORMAT,PARASOLID_FORMAT,SHAPEFILE_FORMAT,STL_FORMAT or VDA_FORMAT
c.. error: boolean 0 or 1 to indicate an error when reading.
proc SaveGIDProject { filespd } {
set fp [open $filespd w]
if { $fp != “” } {
#save the specific problemtype data file contents …
close $fp
}
}

proc AfterOpenFile { filename format error } {
WarnWinText “$filename $format $error”
if { $format == “GID_GEOMETRY_FORMAT” } {
#open and read the additional file contents.
#the name of the file to open can be obtained from filename, e.g.
set filespd [file join $filename [file tail $filename].spd]
if { [file exists $filespd } {
set fp [open $filespd r]
#read the specific problemtype data file contents …
close $fp
}
}
}

Instead AfterOpenFile, it’s also possible to use the procedure LoadGIDProject , but note that this event is called when reading a model, but also when reading a problemtype (because it is like a special model). It’s more recommended to use AfterOpenFile.
proc LoadGIDProject { filespd } {
…body…
}
----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gid.cimne.upc.es
Sent: Thursday, January 05, 2006 4:10 PM
Subject: [GiDlist] Save the Problem Type


Hi!

I save my problem type, for example like teste.gid.
When i close the program and i open teste.gid, all values saved and assigned don’t appear.
What’s appening? There is any procedure to save that values before close problem type?


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20060118/403d1ea8/attachment.htm