I thought I'd posted this before, but I'm not finding it now.....
(defun c:vtx-del (/ bulges coords ent idx param pt)
(defun removenth (n lst / i rtn)
(reverse
(progn
(setq i -1)
(foreach x lst
(if (/= n (setq i (1+ i)))
(setq rtn (cons x rtn))
)
)
rtn
)
)
)
(command "undo" "be")
(while (and (setq ent (entsel "\nSelect vertex to remove: "))
(eq (cdr (assoc 0 (entget (car ent)))) "LWPOLYLINE")
(setq pt (osnap (cadr ent) "near")
ent (vlax-ename->vla-object (car ent)))
)
(setq param (atoi (rtos (vlax-curve-getparamatpoint ent pt) 2 0)))
(setq coords (vlax-get ent 'coordinates)
idx -1
bulges nil)
(repeat (/ (length coords) 2)
(setq bulges (cons (vla-getbulge ent (setq idx (1+ idx))) bulges))
)
(setq bulges (removenth param (reverse bulges)))
(repeat 2
(setq coords (removenth (* 2 param) coords))
)
(vlax-put ent 'coordinates coords)
(setq idx -1)
(foreach bulge bulges
(vla-setbulge ent (setq idx (1+ idx)) bulge)
)
)
(command "undo" "end")
(princ)
)