Maybe this would work
;;; By Isaac A.
;;; https://www.cadtutor.net/forum/topic/76618-how-to-create-circle-in-every-corner-of-polyline-and-trim-circles-inside/
;;; Draws circles in every vertex of plines and trims them
(defun c:ctri (/ b foo ss)
(if (not etrim) (load "extrim.lsp"))
(defun foo (p) ;; Alan J. Thompson, 09.09.10
;; https://www.cadtutor.net/forum/topic/25037-drawing-circles-to-all-vertices-of-polyline/
(if (vl-consp p)
(or (vl-member-if
(function (lambda (a) (equal (list (car a) (cadr a)) (list (car p) (cadr p)))))
plst
)
(setq plst (cons (cdr (assoc 10 (entmake (list '(0 . "CIRCLE") (cons 10 p) (cons 40 b)))
)
)
pLst
)
)
)
)
)
(if (and (setq ss (ssget '((0 . "*POLYLINE")))) (not (initget 6)) ;;; (setq i -1)
(setq b (getdist "\nSpecify circle radius :"))
)
((lambda (i / e eLst p pLst)
(while (setq e (ssname ss (setq i (1+ i))))
(vl-position (cdr (assoc 0 (entget e))) '("LWPOLYLINE" "POLYLINE"))
(repeat (setq p (1+ (fix (vlax-curve-getEndParam e))))
(foo (vlax-curve-getPointAtParam e (setq p (1- p))))
)
(etrim e (ia:midp (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e)))
;;; (osnap (vlax-curve-getStartPoint e) "gcen")
)
)
-1
)
)
(princ)
)
;;; ia:midp
;;; Returns the midpoint of 2 given points
(defun ia:midp (a b)
(mapcar '* (mapcar '+ a b) '(0.5 0.5 0.5))
)
Although most of the code is from Alan J. T., thanks for sharing your codes.
This will work with open polylines but as has been said it will not work on the start and end point because it needs 2 points on the polyline to trim the circles.
HTH.