Not quite, that's getting the total length of the polyline, not just the bottom pline segment.
Known properties...
Always a polyline
Is rectangular
Always on the same layer
The bottom horizontal line segment is always divisible by 34
The rectangle always starts at and ends at 0,0
all segments are in the positive X and Y axis.
I only need the length of the bottom polyline segment
; Pline segment with angle and length
(defun c:plseg()
(setq plent (entsel "\nSelect Pline "))
(setvar "osmode" 0)
(setq
pick (cadr plent)
plObj (vlax-ename->vla-object (car plent))
pick2 (vlax-curve-getclosestpointto plobj pick)
param (vlax-curve-getparamatpoint plObj pick2)
segment (fix param)
co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent)))))
(setq pt1 (nth segment co-ord))
(setq pt2 (nth (+ segment 1) co-ord))
(if (= pt2 nil)(setq pt2 (nth 0 co-ord)))
(setq len (distance pt1 pt2))
(setq ang (angle pt1 pt2))
(alert (strcat "angle is " (rtos (/ (* ang 180.0) pi) 2 2) " Length is " (rtos len 2 3)))
)
Code - Auto/Visual Lisp: [Select]
;;----------------------------------------------------------------------------;; ;; sets dimscale ) ) ) ) ) )