@DC-MWA wrote:

Points in between 1st and 2nd pick
(Defun c:STW (/ fp sp pl verts thistwopoints n) ; Show These points
;; pBe May 2020 ;;;
(defun xy (p)(list (Car p)(cadr p)))
(if
(and
(setq fp (getpoint "\nPick first reference point"))
(setq sp (getpoint fp "\nPick next point"))
(setq pl (car (nentselp fp)))
)
(progn
(setq verts (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget pl))))
(setq thistwopoints (vl-sort (mapcar '(lambda (w)
(vl-position (xy w) verts))(list fp sp)) '<))
((lambda (n)
(repeat (1- (/ (abs (apply '- thistwopoints)) 2))
;; repeated function here
(entmake (list (cons 0 "POINT") (cons 10 (nth (setq n (+ 2 n)) verts))))
)
)
(car thistwopoints)
)
)
)
(princ)
)
If you want to include all points including 1st and second pick
((lambda (n)
(repeat (1+ (/ (abs (apply '- thistwopoints)) 2))
;; repeated function here
(entmake (list (cons 0 "POINT") (cons 10 (nth n verts))))
(setq n (+ 2 n))
)
)
(car thistwopoints)
)
If you only want to include ONLY the first pick [ the direction of the polyline plays a role here, you can add check for polylline direction ]
((lambda (n)
(repeat (/ (abs (apply '- thistwopoints)) 2)
;; repeated function here
(entmake (list (cons 0 "POINT") (cons 10 (nth (setq n (+ 2 n)) verts))))
)
)
(car thistwopoints)
)
HTH