The macros toolbar have has buttons that call calls the Tcl code. Most buttons and procs are predefined, for common use, but each user can add its own buttons (they are stored with its his preferences) , to do some interesting actionactions.
See Macros
In particular the Tcl code can invoke Python code with the procs related previously: GiD_Python_Exec, GiD_Python_Call, GiD_Python_Source, …
...