There are only few ways to get interactive contact out of the gdl-code of objects:
1. The object is feeded by an AddOn
2. Is part of another (skylight, window, door)
3. Is a zone-stamp
4. Is an associative attached label
In all these cases the data stream is unidirectional TO the object. The usage of object-calculation or settings back to the project (as e.g. skylights do) will done, if it's possible at all, from mechanisms outside of the gdl-code.
There is no realy good working possibility to interact between two objects. There is a way, posted here a time ago, to interact between two objects by using a textfile or other external stuff. If it's not absolutely necessary, I wouldn't recommend.
There is one exception:
Labels and markers can REQUEST parameters of the drawing elements they are attached to. Have a look to
REQUEST ("ASSOCLP_PARVALUE", .... There is written here something too. Give SEARCH a try.
😉
And of course there a the GLOBAL parameters and the other REQUESTable global system environments.
There are no GDL-statements to get access to the project database. No SQL-commands. Sorry.
Question back: What do you want to do?