Assuming selection of pre-drawn open-ended Polylines of only line-variety end segments, and with the "indicator" Block redefined as suggested in my earlier Reply, is this not enough? [It works for me in your sample drawing.]
(defun C:APBE (/ ss n pl); = Arrows on Polylines, Both Ends
(if (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . "<NOT") (-4 . "&") (70 . 1) (-4 . "NOT>"))))
(repeat (setq n (sslength ss)); then
(setq pl (ssname ss (setq n (1- n))))
(command
"_.insert" "indicator" "_non" (vlax-curve-getStartPoint pl)
1 1 "_non" (vlax-curve-getPointAtParam pl 1)
"_.insert" "indicator" "_non" (vlax-curve-getEndPoint pl)
1 1 "_non" (vlax-curve-getPointAtParam pl (1- (vlax-curve-getEndParam pl)))
); command
); repeat
); if
(prin1)
)
If you want them, it could use Undo begin/end wrapping, Layer control, *error* handling, perhaps Block scaling dependent on the drawing's intended scale.
Open-endedness is required by the selection filter, but having line segments at the ends is up to you [though it could be enhanced to check for that, or in a different way to just use the direction rather than the next vertex in].
Kent Cooper, AIA