I think I misunderstood your explanation of what you needed.
Anyway, the code can be easily adapted to what you asked for.
I've corrected the small oversight in the 'grvecs' functions, which I included at the last minute and didn't check.
Here is the modified code, in case anyone finds it useful...
(defun c:ptoZmin? (/ ent lstent punto lstpts zMin ptoZmin conj n)
(setq n 0)
(if (setq conj (ssget '((0 . "POLYLINE"))))
(while (setq ent (ssname conj n))
(setq lstent (entget ent))
(while
(/=
(cdr
(assoc
0
(setq lstent (entget (entnext (cdr (assoc -1 lstent)))))
)
)
"SEQEND"
)
(setq punto (cdr (assoc 10 lstent)))
(if zMin
(if (= (min zMin (last punto)) (last punto))
(setq zMin (last punto)
ptoZmin punto
)
)
(setq zMin (last punto)
ptoZmin punto
)
)
)
(setq n (1+ n))
)
)
(if ptoZmin
(progn
(grdraw
(polar ptoZmin 0.785398 (* 0.025 (getvar "viewsize")))
(polar ptoZmin 3.92699 (* 0.025 (getvar "viewsize")))
2
1
)
(grdraw
(polar ptoZmin 2.35619 (* 0.025 (getvar "viewsize")))
(polar ptoZmin 5.49779 (* 0.025 (getvar "viewsize")))
2
1
)
(alert (strcat "Point with minimum Z:\nX = " (rtos (car ptoZmin) 2 2) "\nY = "(rtos (cadr ptoZmin) 2 2) "\nZ = "(rtos (caddr ptoZmin) 2 2)))
(princ (strcat "\nPoint with minimum Z:\nX = " (rtos (car ptoZmin) 2 2) "; Y = "(rtos (cadr ptoZmin) 2 2) "; Z = "(rtos (caddr ptoZmin) 2 2)))
)
)
(princ)
)