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

...body...

set value ...

return $value

}

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

...body...

set value ...

return $value

}

proc AfterMeshGeneration { fail } {

...body...

set value ...

return $value

}

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

}

proc AfterCreateLayer { name } {

}

proc AfterRenameLayer { oldname newname } {

}

proc BeforeDeleteLayer { name } {

...body...

set value ...

return $value

}

proc AfterChangeLayer {name property } {

}

proc AfterSetLayerToUse { name } {

}

proc AfterChangeLicenceStatus { status } {

}

If it returns -cancel- as a value then the swapping to postprocess mode will be cancelled.

If it returns -cancel- the mesh generation is cancelled.

If it returns -cancel- ?<message>? then the window showing the end of the mesh generation will not be raised, but the mesh is not deleted. <message> is an optional message to be shown in the message bar.

Geometry: must be ALL_LT.

Mesh: could be NODE_LT or ELEM_LT.

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.

If it returns nowindow as a value then the window that inform about the finished process will not be opened.

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.

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).

If "" is returned instead "xmin ymin zmin xmax ymax zmaz" then any additional bounding box is considered.

If it returns -cancel- the layer deletion is cancelled.

whit RRR, GGG, BBB, AAA from 0 to 255

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.