Returns the name of the next object (entity) in the drawing
Supported Platforms: Windows and Mac OS
(entnext [ename])
Type: ads_name
The name of an existing entity.
Type: ads_name or nil
If entnext is called with no arguments, it returns the entity name of the first nondeleted entity in the database. If an ename argument is supplied to entnext, the function returns the entity name of the first nondeleted entity following ename in the database. If there is no next entity in the database, it returns nil. The entnext function returns both main entities and subentities.
(setq e1 (entnext)) ; Sets e1 to the name of the first entity in the drawing (setq e2 (entnext e1)) ; Sets e2 to the name of the entity following e1