Hi,
I'm not sure that exists an AutoCAD command that returns an objectid, if exist is undocumented. You can get the objectId of an entity with visual lisp vlax-dump-objector vlax-get-property functions. And it's easy to program a .NET command or a lisp function to returns an objectid. Keep in mind that object ids are not persistent between sesions, so are of no use to store or link permanent data.
Gaston Nunez