You cannot access anything about another object. The only way objects can share information is via GDL globals or file I/O.
Add-ons (plug-ins) can access everything, but are only created by experienced programmers.
Will the Element ID Manager not do what you want - to renumber your objects?
One of the forum moderators
AC 27 USA and earlier • macOS Ventura 13.6.9, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB