I've tested CAB's version and did slightly modifications to suit your needs and it works fine...
;; BlockAddEOC.lsp
;; Block Add to End Of Curve
;; CAB 11.13.08 Version 1.1
;; M.R. modified 10.08.12
(defun c:block2end (/ ss s1 bname ent ename lset doc space s sa e ea i )
(vl-load-com)
;; sub to insert the block
(defun InsertBlock (bn pt ang lay aspace)
(setq blk (vla-insertblock
aspace
(vlax-3d-point pt) ; insert point
bn ; block name
1. ; scale x
1.
1.
ang ; radians
)
)
(vla-put-layer blk lay)
blk
)
;;; Returns object to active space (ModelSpace or PaperSpace )
;; CAB 05/31/07
(defun activespace (doc)
(if (or (= acmodelspace (vla-get-activespace doc))
(= :vlax-true (vla-get-mspace doc)))
(vla-get-modelspace doc)
(vla-get-paperspace doc)
)
)
(defun getss@ (pt typs lay / ss sz vs pb swp ar wsd ppdu box)
;;==============================================
;; CAB version
;; do a ssget crossing the size of the pickbox at the pick point
(setq SZ (getvar "SCREENSIZE") ; screen size in pixels
VS (getvar "VIEWSIZE") ; screen height in drawing units
PB (getvar "pickbox") ; get current pickbox size
SWP (car SZ) ; width of screen in pixels
SHP (cadr SZ) ; height of screen in pixels
AR (/ SWP SHP) ; aspect ratio width/height
WSD (* VS AR) ; width of screen dwg units = ratio times height
PPDU (/ WSD SWP) ; pixels per drawing unit
BOX (/ (* VS (* 2 PB)) SHP) ; drawing units per pixel
)
(setq ss (ssget "_C"
(polar pt 0.785 box)
(polar pt 3.93 box)
(list (cons 0 typs) (cons 8 lay))
)
)
)
;;=============================
;; Start Here
(setq CurveLay "*") ; filter for curve layer
(setq blklay "0") ; filter for block layer
(prompt "\nSelect block to use or ENTER key to name block.")
(if
(and
(or
(and (setq ss (ssget "_+.:E:S" '((0 . "INSERT"))))
(setq ent (ssname ss 0))
(setq bname (cdr(assoc 2 (entget ent)))))
(and (setq bname (getstring t "\nName of block to copy: "))
(or (tblsearch "Block" bname)
(prompt (strcat "Cannot find Block " bname ", Ending."))))
)
(or (prompt "\nSelect curves to test.")
(setq lset (ssget (list '(0 . "*line,ellipse,arc")(cons 8 CurveLay)))) ;filter curve in selection set
)
)
(progn
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object))
space (activespace doc))
(vla-EndUndoMark doc)
(vla-StartUndoMark doc)
(vla-zoomextents (vlax-get-acad-object))
(setq i -1)
(while (setq ename (ssname lset (setq i (1+ i))))
(setq sa (angle '(0.0 0.0 0.0) (vlax-curve-getfirstderiv (vlax-ename->vla-object ename) (vlax-curve-getstartparam (vlax-ename->vla-object ename))))
ea (angle (vlax-curve-getfirstderiv (vlax-ename->vla-object ename) (vlax-curve-getendparam (vlax-ename->vla-object ename))) '(0.0 0.0 0.0))
s (vlax-curve-getstartpoint (vlax-ename->vla-object ename))
e (vlax-curve-getendpoint (vlax-ename->vla-object ename)))
(if (= (sslength (getss@ s "*LINE,ELLIPSE,ARC" Curvelay)) 1)
(InsertBlock bname s sa blklay space)
)
(if (= (sslength (getss@ e "*LINE,ELLIPSE,ARC" Curvelay)) 1)
(InsertBlock bname e ea blklay space)
)
)
(vla-zoomprevious (vlax-get-acad-object))
(vla-EndUndoMark doc)
)
) ; endif
(princ "\nThe blocks have been copied")
(princ)
)
(princ "\nType block2end to invoke")
(princ)
M.R.