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 28 USA and earlier • macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB