entnext
(entnext [ename])
The entnext function retrieves an entity in the current drawing database that follows the entity specified by ename and returns its name.
If ename contains the entity name of a Polyline or an Insert (Block insertion), the function returns the first sub-element of that complex object (a Vertex or an Attribute) as the next entity.
If you enter entnext with no argument, the function returns the first entity stored in the current drawing database.
: (setq ent1 (entnext)) ; First entity stored in database
: (setq ent2 (entnext ent1))