Not really, the library isn’t designed to allow communication between objects.
There maybe a hackish solution using the text I/O addon, but that wouldn’t handle delete, undo/redo and copy/paste workflows.
After placement ArchiCAD will auto-increment the ID of the next element in the infobox if it ends with a digit.
You can use GLOB_INTGUID if you don’t need to count the objects, just a distinct ID.
Library Platform, Software Engineer