Why not a couple of extra questions, does each pline exist fully in that it is a closed pline around the text, not 1 close and the other 2 are "U" touching each other, its not a problem as I would use Bpoly and ignore your cyan plines in case they are multi plines & lines.
Working on something give it a try, DONT have Excel open is easiest. Just pick 1 text, then select all required text.
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/list-the-length-of-all-segments-of-a-polyline/td-p/7506972/page/3
(defun c:wow ( / putcell2 lay ss lst lst2 tot len ins txt co-ord area d I K X myxl)
;; Thanks to fixo ;;
;; = Set Excel cell text = ;;
;; ;;
(defun putcell2 (row column text)
(setq cells (vlax-get-property (vlax-get-property myxl "ActiveSheet") "Cells"))
(vl-catch-all-apply
'vlax-put-property
(list cells 'Item row column
(vlax-make-variant (vl-princ-to-string text) vlax-vbstring)))
)
(setq lay (cdr (assoc 8 (entget (car (entsel "\nPick text for layer search "))))))
(setq ss (ssget (list (cons 0 "TEXT")(Cons 8 lay)(cons 410 (getvar 'ctab)))))
(if (= ss nil)
(progn
(alert "You did not pick any text on correct layer \n\nwill exit now")
(exit)
)
)
(setvar 'dimzin 3)
(setq lst '() tot 0)
(repeat (setq x (sslength ss))
(setq ent (ssname ss (setq x (1- x))))
(setq ins (cdr (assoc 10 (entget ent))))
(setq txt (cdr (assoc 1 (entget ent))))
(command "bpoly" ins "")
(setq area (vlax-get (vlax-ename->vla-object (entlast)) 'area))
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10))
(entget (entlast)))))
(entdel (entlast))
(setq K 0 lst2 '())
(repeat (- (length co-ord) 1)
(setq d (rtos (abs (distance (nth k co-ord) (nth (1+ k) co-ord))) 2 3 ))
(setq lst2 (cons d lst2))
(setq k (1+ k))
)
(setq d (rtos (abs (distance (last co-ord) (nth 0 co-ord))) 2 3 ))
(setq lst2 (cons d lst2))
(setq cols (length lst2))
(if (> cols tot)(setq tot cols))
(setq lst (cons (list txt area lst2) lst))
)
(setq lst (reverse lst))
(or (setq myxl (vlax-get-object "Excel.Application"))
(setq myxl (vlax-get-or-create-object "excel.Application"))
)
(vla-put-visible myXL :vlax-true)
(vlax-put-property myxl 'ScreenUpdating :vlax-true)
(vlax-put-property myXL 'DisplayAlerts :vlax-true)
(or (setq wks (vlax-get myxl 'ActiveSheet))
(vlax-invoke (vlax-get myxl 'workbooks) 'Add)
)
(putcell2 1 1 "Text inside")
(putcell2 1 2 "Area")
(putcell2 1 3 "Lengths")
(setq row 2 col 2 I -1)
(foreach val lst
(putcell2 row 1 (car val))
(putcell2 row 2 (cadr val))
(setq val2 (caddr val))
(setq len (length val2))
(repeat len
(putcell2 row (setq col (1+ col)) (nth (setq I (1+ I)) val2))
)
(setq col 2)
(setq row (1+ row) i -1)
)
(princ)
)
(c:wow)
2nd question do you want a Table, and an export to Excel ? Please confirm.