GiD - The personal pre and post processor

Event procedures

A 'Event procedure' is a Tcl procedure that is invoked from GiD when doing some actions. I allows developers to interleave its code with the GiD flow.


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:


Note: is is possible to get the ordered list of Tcl events with the procedure GiD_Info events


Note: default values are category==GENERAL and propietary==gid


To be called a Tcl procedure must be previously registered, using


GiD_RegisterEvent <event_name> <procedure> ?<category>? ?<propietary>?
<event_name> must be a valid event, like GiD_Event_InitProblemtype
<procedure> is the name of our procedure, with appropiated prototype of arguments
Can know the expected arguments with the command GiD_Info events -args <event_name>, or reading this documentation.
Avoid to use as procedure name the event_name, to avoid conflicts. It is recommended for example use a prefix or namespace that suggest that is defined by our own problemtype, etc.)

<category>: GENERAL, PROBLEMTYPE, PLUGIN (default==GENERAL)
used for a better classification.
<propietary>: the name of our problemtype, etc. (according with category, default == gid)

GiD defined events are of category=GENERAL and propietary=gid, these are the default values in case of missing parameters

The category and propietary allow automatically unregister events when unloading a problemtype or plugin.

GiD_UnRegisterEvent <event_name> <procedure> ?<category>? ?<propietary>?
To unregister an event, previously registered with GiD_RegisterEvent

GiD_UnRegisterEvents ?<category>? ?<propietary>?
To unregister all events of a category and propietary

GiD_GetRegisteredEventProcs <event_name> ?<category>? ?<propietary>?
To get the list of procedures registered for the event, category and propietary

GiD_GetRegisteredEventProcsAll <event_name>
To get all procedures registered for an event, without take into accoult the category and propietary.

GiD_GetIsRegisteredEvent <event_name>
Return 1 if there is some procedure registered for the event, 0 else

GiD_GetIsRegisteredEventProc <event_name> <procedure> ?<category>? ?<propietary>?
Return 1 if this procedure is registered for the event, 0 else

RaiseEvent_Registered <event_name> <args>
To raise an event from Tcl scripting (providing the appropriated arguments)

COPYRIGHT © 2022 · GID · CIMNE