- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Hi
Is there any way to take total length of 5 or 6 lines in selection
Please help me
Ragards
Ramjan
¡Resuelto! Ir a solución.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Hi Ram,
The easy way to get the total length of multiple lines is to use lisp.
Here is the code:
(defun C:TLEN (/ ss tl ent)
(setq
ss (ssget '((0 . "LINE,ARC,CIRCLE,*POLYLINE,SPLINE,ELLIPSE")))
tl 0
); end setq
(repeat (sslength ss)
(setq
ent (ssname ss 0)
tl
(+
tl
(vlax-curve-getDistAtParam ent (vlax-curve-getEndParam ent))
); end + & tl
); end setq
(ssdel ent ss)
); end repeat
(alert (strcat "Total length of selected objects is " (rtos tl)))
(princ)
); end defun
If you don't know how to use lisp, here is a link:
See also screencasts below.
Thank you. ![]()
BIM Modeler
Technical Officer
Technical Designer
Sr. Draftsman
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Hi,
Here is a LISP to find all lengths of selected lines or polylines. File attached. (Credits : Tee Square Graphics 1998) TLEN
(defun C:TLEN (/ ss tl n ent itm obj l)
(setq ss (ssget)
tl 0
n (1- (sslength ss)))
(while (>= n 0)
(setq ent (entget (setq itm (ssname ss n)))
obj (cdr (assoc 0 ent))
l (cond
((= obj "LINE")
(distance (cdr (assoc 10 ent))(cdr (assoc 11 ent))))
((= obj "ARC")
(* (cdr (assoc 40 ent))
(if (minusp (setq l (- (cdr (assoc 51 ent))
(cdr (assoc 50 ent)))))
(+ pi pi l) l)))
((or (= obj "CIRCLE")(= obj "SPLINE")(= obj "POLYLINE")
(= obj "LWPOLYLINE")(= obj "ELLIPSE"))
(command "_.area" "_o" itm)
(getvar "perimeter"))
(T 0))
tl (+ tl l)
n (1- n)))
(alert (strcat "Total length of selected objects is " (rtos tl)))
(princ)
)
Cheers,
Vinay Vijayakumaran ![]()