Not to criticize but to show you the normal convention of how things are coded.
In your ss_get routine, the name ss_get implies that you are going after a selection set.
'ent' is used for entites and 'ss' for selection sets, & 'lst' for list.
There may only be one entity in you selection set but it is still a selection set.
I see, as you say the ss_get will not return nil so the IF I had added is not needed.
Also not needed is the test in the next IF ( and ss because the ss will always be a
selection set with 0 or 1 entity in it. See the revised code.
(defun c:test (/ sel obj pt ent)
(setq obj (car (entsel "\nPick ent to match."))
pt nil
)
(prompt "\nSelect point on object.")
(while (not pt) ; only valid when obj is selected
(setq sel (ss_get ":E:S"))
(mapcar
'(lambda (x)(if (not (eq x obj)) (ssdel x sel)))
(ssnames sel)
)
(if (> (sslength sel) 0)
(setq ent (ssname sel 0)
pt (last (last (car (ssnamex sel 0))))
)
(princ "\nPoint not on Polyline. Please try again. ")
)
)
)
(defun ssnames (ss / idx lst)
(setq idx (sslength ss)
lst (list)
)
(while (>= (setq idx (1- idx)) 0)
(setq lst (cons (ssname ss idx) lst))
)
)
(defun ss_get (lst / ss)
(while (not ss)
(prompt "\nSelect side to extend: ")
(cond ((setq ss (ssget lst)))
((= (getvar "ErrNo") 52)
(exit)) ; ENTER pressed
((null ss)
(princ "\nSelection missed. Please try again."))
)
)
ss ; return a selectionset, never nil
)