Are we talking about these?
; Rune Wold and Michael Puckett - modified
; e.g. usage (setq marker (ALE_LASTENT))
;
; Version 1.01 - 20/12/2004
;
; Description:
; get the absolute last entity in the database,
; for problems in >=r15 in blocks with attrib, and polylines
;
; Arguments: none
;
; Return Values:
; An entity name;
; otherwise nil, if there are no entities in the current drawing
;
; Example: (setq marker (ALE_LASTENT))
;
(defun ALE_LastEnt ( / EntNam OutVal)
(and
(setq OutVal (entlast))
(while (setq EntNam (entnext OutVal))
(setq OutVal EntNam)
)
)
OutVal
)
;
; Marc'Antonio Alessi - http://xoomer.virgilio.it/alessi
; Function: ALE_Ss-After
;
; Version 1.01 - 20/12/2004
; Version 1.02 - 30/09/2005
;
; Description:
; get a selection set of items after EntNam in the database
;
; Arguments: An entity name
;
; Return Values:
; A selection set;
; otherwise nil, if there are no entities after EntNam
;
; Examples:
; (setq marker (ALE_LASTENT)) ...create new entities...
; to include reference entity:
; (command "_.MOVE" (ALE_SS-AFTER marker) marker "" ...)
; Note: NOT valid if marker is a SEQEND of
; blocks with attrib or old polylines (PLINETYPE = 0)
;
; not include reference entity:
; (command "_.MOVE" (ALE_SS-AFTER marker) "" ...)
;
(defun ALE_Ss-After (EntNam / SelSet)
(cond
( (not EntNam) (ssget "_X") )
( (setq EntNam (entnext EntNam))
(setq SelSet (ssadd EntNam))
(while (setq EntNam (entnext EntNam))
(if (entget EntNam) (ssadd EntNam SelSet))
)
SelSet
)
)
)