Just had time to test these today.
The only one that seems to work is Le3's (by looking at pics)
With the example shown, output should only include: ("125" "109" "125" "80" "100")
Testing open and closed polylines...
Vovka's Output (w/o including isboundaryclockwise)
("90" "125" "109" "125" "80" "190") for both
Lee's Output
("90" "125" "109" "125" "80" "10") for both
Elpanov's output
1st code ("90" "125" "109" "125" "80" "10") for both
2nd code
("235" "251" "235" "280" "180" "260") for open polyline
"; error: bad argument type: 2D/3D point: nil" for closed polyline
T.Willey's output
"; error: no function definition: nil" for both
**EDIT**
Was missing the RTD function...output was
("10" "80" "125" "109" "125" "90") for closed
nil (as intended) for open
Using some of the supplied code by Lee and Vovka, this seems to work for both open and closed
(defun GetLeftAngle ( p2 / p1 p3 pos)
(setq pos (vl-position p2 l) p1 (nth (rem (+ n(1- pos)) n) l) p3 (nth (rem (+ n (1+ pos)) n) l))
(rem (+ pi pi (- (angle p2 p1) (angle p2 p3))) (+ pi pi))
)
(defun c:test ( / l m n)
(setq n (length (if (member nil (mapcar '(lambda (x y) (eq x y))
(car (setq l (mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= (car x) 10)) (entget (car (entsel)))))))
(last l))) l (setq l (cdr l))))
l (mapcar 'GetLeftAngle l))
(mapcar 'angtos (if (< (apply '+ l) (apply '+ (setq m (mapcar '(lambda ( x ) (- (* 2. pi) x)) l)))) l m))
)
*EDIT*
I'm including the example drawing.