- Start / End
GiD_Event_InitProblemtype
GiD_Event_BeforeInitProblemtype
GiD_Event_EndProblemtype
GiD_Event_AfterChangeProblemtype
GiD_Event_AfterSetProblemtypeName
- Read / Write
GiD_Event_LoadModelSPD
GiD_Event_LoadProblemtypeSPD
GiD_Event_SaveModelSPD
- Transform
GiD_Event_BeforeTransformProblemType
GiD_Event_AfterTransformProblemType
- Materials
GiD_Event_AfterCreateMaterial
GiD_Event_AfterRenameMaterial
GiD_Event_BeforeDeleteMaterial
GiD_Event_AfterChangeMaterial
GiD_Event_AfterAssignMaterial
- Conditions
GiD_Event_AfterCreateCondition
GiD_Event_BeforeDeleteCondition
GiD_Event_AfterChangeCondition
- Intervals
GiD_Event_AfterCreateInterval
GiD_Event_BeforeDeleteInterval
GiD_Event_AfterDeleteInterval:
GiD_Event_AfterSetIntervalToUse
- Units
GiD_Event_AfterChangeModelUnitSystem
- Calculation file
GiD_Event_BeforeWriteCalculationFile
GiD_Event_AfterWriteCalculationFile
GiD_Event_SelectOutputFilenames
- Run
GiD_Event_SelectGIDBatFile
GiD_Event_BeforeRunCalculation
GiD_Event_AfterRunCalculation
Event procedures>problemtype>Start / End
GiD_Event_InitProblemtype / GiD_Event_BeforeInitProblemtype: will be called when the problem type is selected. It receives the dir argument, which is the absolute path to the problem_type_name.gid directory, which can be useful inside the routine to locate some alternative files.
proc GiD_Event_InitProblemtype { dir } {
}
proc GiD_Event_BeforeInitProblemtype { dir } {
}
Note:InitGIDProject is a deprecated alias of GiD_Event_InitProblemtype
GiD_Event_EndProblemtype: will be called when this project is about to be closed. It has no arguments.
proc GiD_Event_EndProblemtype {} {
}
Note: EndGIDProject is a deprecated alias of GiD_Event_EndProblemtype
GiD_Event_AfterChangeProblemtype
proc GiD_Event_AfterChangeProblemtype { oldproblemtype newproblemtype } {
}
GiD_Event_AfterSetProblemtypeName
proc GiD_Event_AfterSetProblemtypeName { name } {
}
Event procedures>problemtype>Read / Write
GiD_Event_LoadModelSPD: will be called when a GiD project is loaded. It receives the argument filespd, which is the path of the file which is being opened, but with the extension .spd (specific problemtype data). This path is tipically the file of the model where the problemtype store its own data.
proc GiD_Event_LoadModelSPD { filespd } {
}
Note: GiD_Event_AfterLoadGIDProject Will be called when a GiD project is loaded, but not when a problem type is loaded, then could be used instead of GiD_Event_LoadModelSPD as an oportunity to load the problemtype data of the model.
GiD_Event_LoadProblemtypeSPD: will be called when a problem type is loaded. It receives the argument filespd, which is the path of the file which is being opened, but with the extension .spd (specific problemtype data).
This path is tipically the file of the problemtype where the problemtype define its own data.
proc GiD_Event_LoadProblemtypeSPD { filespd } {
}
Note:LoadGIDProject is a deprecated confusing event, that is called in both cases: GiD_Event_LoadModelSPD and GiD_Event_LoadProblemtypeSPD
GiD_Event_SaveModelSPD: will be called when the currently open file is saved to disk. It receives the argument filespd, which is the path of the file being saved, but with the extension .spd (specific problemtype data). This path can be useful if you want to write specific information about the problem type in a new file.
proc GiD_Event_SaveModelSPD { filespd } {
}
Note:SaveGIDProject is a deprecated event alias of GiD_Event_SaveModelSPD
Event procedures>problemtype>Transform
GiD_Event_BeforeTransformProblemType: will be called just before transforming a model from a problem type to a new problem type version. If it returns cancel as a value then the transformation will not be invoked.
- 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.
proc GiD_Event_BeforeTransformProblemType { file oldproblemtype newproblemtype } {
...body...
set value ...
return $value
}
GiD_Event_AfterTransformProblemType: will be called just after transforming a model from a problem type to a new problem type version.
It must return a list of the items: value and messages
value 1 if there were model changes done in this procedure, 0 else.
If it returns cancel as a special value, then the transformation messages won't be shown.
- 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.
- messages: explains the transforming operations done.
proc GiD_Event_AfterTransformProblemType { file oldproblemtype newproblemtype messages } {
...body...
set value ...
return [list $value $messages]
}
Event procedures>problemtype>Materials
GiD_Event_AfterCreateMaterial: will be called just after create the material 'name'
proc GiD_Event_AfterCreateMaterial { name } {
}
GiD_Event_AfterRenameMaterial: will be called just after the mateial 'oldname' has been renamed to 'newname'
proc GiD_Event_AfterRenameMaterial { oldname newname } {
}
GiD_Event_BeforeDeleteMaterial: will be called just before delete the material 'name'
If it returns cancel the material deletion is cancelled.
proc GiD_Event_BeforeDeleteMaterial { name } {
...body...
set value ...
return $value
}
GiD_Event_AfterChangeMaterial: will be called just after change some field value of the material 'name'.
changedfields is a list with the index of the changed fields (index starting from 1)
proc GiD_Event_AfterChangeMaterial { name changedfields } {
}
GiD_Event_AfterAssignMaterial: will be called just after assign or unassign the material of some entities.
- name is the name of the new material. If it is "" then the material has been unassigned.
- leveltype: is the kind of entity, if could be:
For geometry: POINT_LT, LINE_LT, SURFACE_LT,VOLUME_LT
For mesh: ELEM_LT.
proc GiD_Event_AfterAssignMaterial { name leveltype } {
}
Event procedures>problemtype>Conditions
GiD_Event_AfterCreateCondition: will be called just after create the condition 'name'
proc GiD_Event_AfterCreateCondition { name } {
}
GiD_Event_BeforeDeleteCondition: will be called just before delete the condition 'name'
If it returns cancel the material condition is cancelled.
proc GiD_Event_BeforeDeleteCondition { name } {
...body...
set value ...
return $value
}
GiD_Event_AfterChangeCondition: will be called just after change some field value of the condition 'name'.
changedfields is a list with the index of the changed fields (index starting from 1)
proc GiD_Event_AfterChangeCondition { name changedfields } {
}
Event procedures>problemtype>Intervals
GiD_Event_AfterCreateInterval: will be called just after a new interval is created, providing its integer id
proc GiD_Event_AfterCreateInterval { interval_id } {
}
GiD_Event_BeforeDeleteInterval: will be called just before a interval is deleted, providing its integer id
If it returns cancel the interval deletion is cancelled.
proc GiD_Event_BeforeDeleteInterval { interval_id } {
...body...
set value ...
return $value
}
GiD_Event_AfterDeleteInterval: will be called just after a interval is deleted, providing its integer id
proc GiD_Event_AfterDeleteInterval { interval_id } {
}
GiD_Event_AfterSetIntervalToUse: will be called just after a the current interval is changed, providing its integer id
proc GiD_Event_AfterSetIntervalToUse { interval_id } {
}
Event procedures>problemtype>Units
GiD_Event_AfterChangeModelUnitSystem: will be raised when user change the current unit system or the declared model length units.
old_system and new_system are the names of the units systems before and after the change respectivelly. They could be empty "" or the same (e.g. changing the model length units)
proc GiD_Event_AfterChangeModelUnitSystem { old_unit_system new_unit_system } {
}
Event procedures>problemtype>Calculation file
GiD_Event_BeforeWriteCalculationFile: will be called just before writing the calculation file. It is useful for validating some parameters.
If it returns cancel as a value then nothing will be written.
-
- file: the name of the output calculation file.
proc GiD_Event_BeforeWriteCalculationFile { file } {
...body...
set value ...
return $value
}
GiD_Event_AfterWriteCalculationFile: will be called just after writing the calculation file and before the calculation process. It is useful for renaming files, or cancelling the analysis.
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.
proc GiD_Event_AfterWriteCalculationFile { file error } {
...body...
set value ...
return $value
}
GiD_Event_SelectOutputFilenames: allow to select a custom list of output files to be shown by "Calculate->View process info" (in case that we want to not use the list of 'OutFiles' declared in the bat file).
proc GiD_Event_SelectOutputFilenames { filenames } {
...
return $new_filenames
}
Event procedures>problemtype>Run
GiD_Event_SelectGIDBatFile: must be used to switch the default batch file for special cases.
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.
proc GiD_Event_SelectGIDBatFile { dir basename } {
...body...
set value ...
return $value
}
GiD_Event_BeforeCalculate: will be called a little earlier than GiD_Event_BeforeRunCalculation, e.g. to allow renumber the mesh before write the calculation file and calculate
remote is 0 in case of local calculation, 1 in case or remote (sending to procserverd)
proc GiD_Event_BeforeCalculate { remote } {
...body...
set value ...
return $value
}
GiD_Event_BeforeRunCalculation: will be called before running the analysis. It receives several arguments:
- batfilename: the name of the batch file to be run
- 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 cancel then the calculation is not started.
proc GiD_Event_BeforeRunCalculation { batfilename basename dir problemtypedir gidexe args } {
...body...
set value ...
return $value
}
GiD_Event_AfterRunCalculation: will be called just after the analysis finishes.
If it returns cancelas a value then the window that inform about the finished process will not be opened.
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.
proc GiD_Event_AfterRunCalculation { basename dir problemtypedir where error errorfilename } {
...body...
set value ...
return $value
}