Event procedures |
The structure of problem_type_name.tcl can optionally implement some of these Tcl prototype procedures (and other user-defined procedures). The procedures listed below are automatically called by GiD. Their syntax corresponds to standard Tcl/Tk language:
proc InitGIDProject { dir } {
}
proc BeforeInitGIDPostProcess {} {
}
proc InitGIDPostProcess {} {
}
proc EndGIDProject {} {
}
proc EndGiDPostprocess {} {
}
proc AfterOpenFile { filename format error } {
}
proc AfterSaveImage { filename format } {
}
proc LoadGIDProject { filespd } {
}
proc SaveGIDProject { filespd } {
}
proc LoadResultsGIDPostProcess { file } {
}
proc BeforeMeshGeneration { elementsize } {
}
proc AfterMeshGeneration { fail } {
}
proc AfterRenumber { useof leveltype renumeration } {
}
proc SelectGIDBatFile { dir basename } {
...body...
set value ...
return $value
}
proc BeforeRunCalculation { batfilename basename dir problemtypedir gidexe args } {
}
proc AfterRunCalculation { basename dir problemtypedir where error errorfilename } {
...body...
set value ...
return $value
}
proc ChangedLanguage { language } {
}
proc BeforeWriteCalcFileGIDProject { file } {
...body...
set value ...
return $value
}
proc AfterWriteCalcFileGIDProject { file error } {
...body...
set value ...
return $value
}
proc BeforeTransformProblemType { file oldproblemtype newproblemtype } {
...body...
set value ...
return $value
}
proc AfterTransformProblemType { file oldproblemtype newproblemtype } {
}
proc LoadFileInGidUnknowExtension { filename } {
}
proc TclCalcModelBoundaries{ useof } {
...body...
return "$xmin $ymin $zmin $xmax $ymax $zmax"
}
proc AfterChangeBackground { } {
}
proc BeforeCopy { useof transformation error } {
}
proc AfterCopy { useof transformation error } {
}
proc BeforeMove { useof transformation error } {
}
proc AfterMove { useof transformation error } {
}
proc AfterCreatePoint { num } {
}
proc AfterCreateLine { num } {
}
proc AfterCreateSurface { num } {
}
proc AfterCreateVolume { num } {
}
proc BeforeDeletePoint { num } {
}
proc BeforeDeleteLine { num } {
}
proc BeforeDeleteSurface { num } {
}
proc BeforeDeleteVolume { num } {
}
- filename: the full name of the file that has been read;
- format: ACIS_FORMAT, CGNS_FORMAT, DXF_FORMAT, GID_BATCH_FORMAT, GID_GEOMETRY_FORMAT, GID_MESH_FORMAT, IGES_FORMAT, NASTRAN_FORMAT, PARASOLID_FORMAT, RHINO_FORMAT, SHAPEFILE_FORMAT, STL_FORMAT, VDA_FORMAT, VRML_FORMAT or 3DSTUDIO_FORMAT;
- error: boolean 0 or 1 to indicate an error when reading.
- filename: the full name of the file that has been saved;
- format: eps, ps, tif, bmp, ppm, gif, png, jpg, tga, wrl
- useof : could be GEOMETRYUSE or MESHUSE
- leveltype: the kind of entity that was renumbered.
Geometry: must be ALL_LT.
Mesh: could be NODE_LT or ELEM_LT.
- renumeration:
Geometry: four sublists with the old and new idenfiers for points, lines, surfaces and volumes.
Mesh: a sublist with the old and new identifiers for nodes or elements.
This procedure must return as a value the alternative pathname of the batch file. For example it is used as a trick to select a different analysis from a list of batch calculation files.
- batfilename: the name of the batch file to be run (see Executing an external program );
- basename: the short name model;
- dir: the full path to the model directory;
- problemtypedir: the full path to the Problem Types directory;
- gidexe: the full path to gid;
- args: an optional list with other arguments.
If it returns nowindow as a value then nothing will be written.
It receives as arguments:
- basename: the short name model;
- dir: the full path to the model directory;
- problemtypedir: the full path to the Problem Types directory;
- where: must be local or remote (remote if it was run in a server machine, using ProcServer);
- error: returns 1 if an calculation error was detected;
- errorfilename: an error filename with some error explanation, or nothing if everything was ok.
If it returns -cancel- as a value then nothing will be written.
- file: the name of the output calculation file.
If it returns -cancel- as a value then the calculation is not invoked.
- file: the name of the output calculation file error: an error code if there is some problem writing the output calculation file.
- file: the name of the model to be transformed;
- oldproblemtype: the name of the previous problem type;
- newproblemtype: the name of the problem type to be transformed.
- file: the name of the model to be transformed;
- oldproblemtype: the name of the previous problem type;
- newproblemtype: the name of the problem type to be transformed.
- filename: the name of dropped file.
- useof: can be "GEOMETRYUSE", "MESHUSE", "POSTUSE" or "GRAFUSE".
This procedure must return xmin ymin zmin xmax ymax zmaz of the bounding box of the entities directly managed by the problemtype (this entities must be directly drawn with the drawopengl command).
- useof : could be GEOMETRYUSE or MESHUSE
- transformation : could be ROTATION, TRANSLATION, MIRROR, SCALE, OFFSET, SWEEP or ALIGN
Note: To use Tcl to improve the capabilities of writing the calculations file, it is possible to use the command *tcl in the template file (.bas file); see Specific commands for details.