Two functions required label a point and then send to excel, for me I go direct to Excel.
This is very much a 1st go as need to work out the deflection angle. 552 rows. The make Excel with a name can be added. Its Christmas so limited time.
Do you want a table in dwg as well ?
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polyline-details-to-excel-lisp/td-p/13227556
; 1st go By AlanH DEC 2024
(defun c:pl2excel ( / plent obj num myxl row)
;; Thanks to fixo ;;
;; = Set Excel cell text = ;;
;; ;;
(defun xlsetcelltext ( 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 plent (entsel "\nPick Pline"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent)))))
(progn (alert "you have not picked a pline will now exit")(exit))
)
(setq obj (vlax-ename->vla-object (car plent)))
(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)
(vlax-invoke-method (vlax-get-property myXL 'WorkBooks) 'Add)
(setq row 1)
(xlsetcelltext row 1 "Point ID")
(xlsetcelltext row 2 "Easting")
(xlsetcelltext row 3 "Northing")
(xlsetcelltext row 4 "Distance")
(xlsetcelltext row 5 "Deflection Angle")
(xlsetcelltext row 6 "Station")
(setq num 0)
(foreach pt co-ord
(setq row (1+ row))
(command "text" pt 2.5 0.0 (setq num (1+ num)))
(xlsetcelltext row 1 (rtos num 2 0))
(xlsetcelltext row 2 (car pt))
(xlsetcelltext row 3 (cadr pt))
(setq dist (vlax-curve-getdistatpoint obj pt))
(xlsetcelltext row 4 (rtos dist 2 1))
)
(princ)
)