Try this, no error checking just select all the text . Note you have plines not lines, but will work with either.
; https://forums.autodesk.com/t5/forums/replypage/board-id/130/message-id/397664
; adjust text to match a line by color
; By AlanH March 2020 info@alanh.com.au
; replace this below for BRISCAD (command "polygon" 20 pt (polar pt 0.0 rad)) ; Briscad
;;-------------------=={ Parse Numbers }==--------------------;;`
;; ;;
;; Parses a list of numerical values from a supplied string. ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; s - String to process ;;
;;------------------------------------------------------------;;
;; Returns: List of numerical values found in string. ;;
;;------------------------------------------------------------;;
(defun LM:ParseNumbers ( s )
(
(lambda ( l )
(read
(strcat "("
(vl-list->string
(mapcar
(function
(lambda ( a b c )
(if
(or
(< 47 b 58)
(and (= 45 b) (< 47 c 58) (not (< 47 a 58)))
(and (= 46 b) (< 47 a 58) (< 47 c 58))
)
b 32
)
)
)
(cons nil l) l (append (cdr l) (list nil))
)
)
")"
)
)
)
(vl-string->list s)
)
)
(defun c:toff ( / offd oldsnap ss ss2 obj ins rad col colnum co-ord obj obj2 obj3 dist ang pt)
(setq offd 0.1) ; change to (setq offd (getreal "\nEnter offset"))
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)
(setq ss (ssget (list (cons 0 "*TEXT"))))
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(setq ins (vlax-get Obj 'insertionPoint))
(setq rad (* 1.5 (vlax-get Obj 'Height)))
(setq col (vlax-get Obj 'Plotstylename))
(setq colnum (car (LM:ParseNumbers col)))
(command "polygon" 20 ins "I" rad) ;Autocad
(setq obj2 (entlast))
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget obj2))))
(command "erase" obj2 "")
(setq ss2 (ssget "F" co-ord (list (cons 0 "*LINE")(cons 62 colnum))))
(setq obj3 (vlax-ename->vla-object(ssname ss2 0)))
(setq pt (vlax-curve-getclosestpointto obj3 ins))
(setq dist (distance pt ins))
(setq ang (angle pt ins))
(setq pt (polar pt ang offd))
(vlax-put Obj 'insertionPoint pt)
)
(setvar 'osmode oldsnap)
(princ)
)