Try this,
It works by drawing temporary plines each 1 element of your selection, and using Tharwats code to plot points at their end and mid points.
EDITED... it adds multiple points at the end of each vertex, just need to do a small modification later
Apparently Tuesdays I have to work as well as Monday, who knew? Will come back to look at this later
(defun c:test ( / endpoint curve midpoints ss acount mycount ent entdesc pt)
(vl-load-com)
;;Get verticies, Points: 10 and Curve: 42
(princ "\nSelect polylines : ")
(setq ss (ssget '((0 . "LWPOLYLINE"))))
(setq acount 0)
(while (< acount (sslength ss))
(setq endpoint (list))
(setq curve (list))
(setq ent (ssname ss acount))
(setq entdesc (entget ent))
(foreach x entdesc
(if (= (car x) 10) (setq endpoint (append endpoint (list (cdr x)))) )
(if (= (car x) 42) (setq curve (append curve (list (cdr x)))) )
)
;;Make temporary plines & get mid points
(setq mycount 1)
(while (< mycount (length endpoint))
(entmake (list (cons 0 "LWPOLYLINE")
(cons 100 "AcDbEntity")
(cons 100 "AcDbPolyline")
(cons 90 2)
(cons 70 0)
(cons 10 (nth (- mycount 1) endpoint))
(cons 42 (nth (- mycount 1) curve))
(cons 10 (nth mycount endpoint))
)) ;;end entmake
(setq ent (entlast))
(setq get (entget ent))
;;From Tharwart
(foreach pt (list (cdr (assoc 10 get))
(vlax-curve-getpointatdist ent (/ (vlax-curve-getdistatpoint ent (vlax-curve-getendpoint ent)) 2.0)))
(entmake (list '(0 . "POINT") (cons 10 pt)))
) ;end for each
(entdel ent) ;;delete temp pline
(setq mycount (+ mycount 1))
) ; end while
(entmake (list '(0 . "POINT") (cons 10 (last endpoint))))
(setq acount (+ acount 1))
) ; end while
(princ)
)