I've corrected the error of my ways. If you're still looking for an alternative, this version will return the angle in both Radians & Degrees:
; PlnLenAng places distance of segment length & angle at pline's vertex
; Response to OP:
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/polyline-lisp/m-p/11777166#M444164
(defun c:PlnLenAng
(/
*error* adoc ang del dst corect_ang csv csvfil eo
i lst luprec p0 p1 pick_poly_chk rad RtD text_height txtstr
)
(if(not(car (atoms-family 1 '("vl-load-com"))))(vl-load-com))
; error function
(defun *error* (msg)
(and
msg
(not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*BREAK*,*EXIT*"))
(princ (strcat "\nError: " msg))
)
(if
(= 8 (logand (getvar 'undoctl) 8))
(vla-endundomark acdoc)
)
(princ)
) ; defun *error*
; converts radians to degrees
(defun RtD (r) (* 180.0 (/ r pi)))
; select pline validation
(defun pick_poly_chk (/ e)
(setq e (car(entsel "\nSelect Open Polyline: ")))
(if
(or
(not e)
(= (getvar 'Errno) 7)
(not (eq "LWPOLYLINE"(cdr(assoc 0 (entget e)))))
(not (zerop (cdr(assoc 70 (entget e))))) ; not closed
)
(pick_poly_chk)
e
)
) ; defun pick_poly_chk
; angle adjustment
(defun corect_ang (ang)(if (and (>= ang (* 0.5 pi))(< ang (* 1.5 pi))) (setq ang (+ ang pi))) ang)
; main function
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(vla-endundomark adoc)
(vla-startundomark adoc)
(if(not *csv*)(setq *csv* (strcat(getvar"dwgprefix")(vl-filename-base (getvar"dwgname")))))
(setq csv(getfiled "Enter Name of CSV File To Save Segment Distances & Angles" *csv* "csv" 1))
(if csv
(progn
(setq *csv* csv)
(setq csvfil (open *csv* "w")) ; open csv to write info
(write-line (strcat"Length, Angle <Radians>, Angle <Degrees>") csvfil) ; segment length & angle Column Title
(if(not *text_height*)(setq *text_height* (getvar"textsize")))
(setq text_height (getreal (strcat"\nText height <" (rtos *text_height* 2 (getvar"luprec"))">: ")))
(if(not text_height)(setq text_height *text_height*)(setq *text_height* text_height))
(if(setq eo (pick_poly_chk)) ; pick pline
(progn
(foreach x (entget eo) ; get pline entity's data
(if (= (car x) 10)
(setq lst (append lst (list (cdr x)))) ; get pline vertices
)
)
(setq luprec (getvar"luprec")) ; get current unit decimal precision
(setq dst(mapcar 'distance lst (cdr lst))) ; get distance between vertices
(setq p0 (nth 0 lst)) ; get 1st point
(setq p1 (nth 1 lst)) ; get 2nd point
(setq ang (corect_ang(+ (angle p0 p1) (* 0.5 pi))))
(setq i 0 del 0)
(repeat (length dst)
(setq p0 (nth i lst)) ; get point
(setq p1 (nth (1+ i) lst)) ; get next point
(setq del (nth i dst)) ; get distance value item from list
(setq ang (rtd (setq rad (angle p0 p1)))) ; get angle
(setq txtstr (strcat (rtos del 2 luprec)","(rtos rad 2 luprec)","(rtos ang 2 luprec))) ; segment length & angle in radians & degrees
; create text
(entmakex
(list
(cons 0 "TEXT")
(cons 100 "AcDbEntity")
(cons 100 "AcDbText")
(cons 1 txtstr)
(cons 10 p1)
(cons 40 *text_height*)
(cons 7 "STANDARD")
(cons 8 "PlnLenAng")
(cons 50 (corect_ang(+ (angle p0 p1) (* 0.5 pi))))
)
) ; entmake
(write-line txtstr csvfil) ; write info to csv
(setq i (1+ i)) ; next list item
) ; repeat cycle through list of distances
(close csvfil) ; close csv
(startapp "Notepad" *csv*)
) ; progn
(progn
(princ"\nNo Open Pline Selected.")(princ)
)
) ; if
) ; progn
(progn
(princ"\nNo CSV File Entered.")(princ)
)
) ; if
(vla-endundomark adoc)
(princ)
) ; defun