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 } {

...body...

}

proc InitGIDPostProcess {} {

...body...

}

proc EndGIDProject {} {

...body...

}

proc EndGiDPostprocess {} {

...body...

}

proc AfterOpenFile { filename format error } {

...body...

}

proc LoadGIDProject { filespd } {

...body...

}

proc SaveGIDProject { filespd } {

...body...

}

proc LoadResultsGIDPostProcess { file } {

...body...

}

proc BeforeMeshGeneration { elementsize } {

...body...

}

proc AfterMeshGeneration { fail } {

...body...

}

proc SelectGIDBatFile { dir basename } {

...body...

set value ...

return $value

}

proc BeforeRunCalculation { batfilename basename dir problemtypedir gidexe args } {

...body...

}

proc AfterRunCalculation { basename dir problemtypedir where error errorfilename } {

...body...

return $value

}

proc ChangedLanguage { language } {

...body...

}

proc BeforeWriteCalcFileGIDProject { file } {

...body...

set value ...

return $value

}

proc AfterWriteCalcFileGIDProject { file error } {

...body...

set value ...

return $value

}

proc AfterTransformProblemType { file oldproblemtype newproblemtype } {

...body...

}

proc LoadFileInGidUnknowExtension { filename } {

...body...

}

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.

If it returns nowindow as a value then nothing will be written.

It receives as arguments:

If it returns -cancel- as a value then nothing will be written.

If it returns -cancel- as a value then the calculation is not invoked.

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.