Message 1 of 3

Not applicable
12-28-2016
12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Here I have a lisp to calculate length of the polylines, could some one help me, here the problem is i am getting different length value.
(defun c:TLlength ( / ss la rv i op)
(while (not ss)
(princ "\nPick the layer")
(setq ss (ssget)))
(initget "Length")
(setq rv "Length")
(setq la (cdr (assoc 8 (entget (ssname ss 0))))
ss (ssget "X" (list (cons 0 "*POLYLINE")
(cons 8 la)))
i (sslength ss)
op 0)
(princ(prompt (alert(strcat "\nTotal " rv
" of the polylines is"
" = " (rtos (cvunit i "inches" "metres") 2 2)
" meters in " (itoa (sslength ss)) "polylines\n"
(if (/= rv "Length")
(strcat (itoa op) " with open polylines") "")))))
(prin1))
Thanks,
Vijay
Solved! Go to Solution.