Hello everyone,

I'm having problems modifying/ creatig a lisp that does:
- draw pline
- p1 = first point = mid of (p1.1,p1.2)
- p2 = second point = mid of (p2.1,p2.2)
- p3 = third pint = mid of (p3.1,p3.2)
- and so on

What I have at the moment is:

Code:
(defun c:pl-mid    ()
  (setq p1-1 (getpoint "\n Insert p1-1:"))
  (setq p1-2 (getpoint "\n insert p1-2:"))
  (setq p2-1 (getpoint "\n insert p2-1:"))
  (setq p2-2 (getpoint "\n insert p2-2:"))
  (setq    px1-1 (car p1-1)
    py1-1 (cadr p1-1)
    px1-2 (car p1-2)
    py1-2 (cadr p1-2)
    px2-1 (car p2-1)
    py2-1 (cadr p2-1)
    px2-2 (car p2-2)
    py2-2 (cadr p2-2)
  )
  (setq p1x-mid (/ (+ px1-1 px1-2) 2))
  (setq p1y-mid (/ (+ py1-1 py1-2) 2))
  (setq p2x-mid (/ (+ px2-1 px2-2) 2))
  (setq p2y-mid (/ (+ py2-1 py2-2) 2))
  (command "pline"
       (list p1x-mid p1y-mid 0.0)
       (list p2x-mid p2y-mid 0.0)
       ""
  )
)
What I don't manage to figure out is how to implement a continuous imput of points from wich to compute the middle distance as the next point of the polyline.
Thanks in advance for any imput.