Something like a distance-command - just that it measures the total length
or area
of a collection of lines or shapes?
for example to know the total lineal meters of wood base on a house, or the
total floor愀 area. I all ready use the TLEN.LSP, but I want to select a
group of layers and have the total length or area of each layer, and if its
posible to make a copy paste to excel or better, have a link so when I
change the lines of a drawing the excel sheet change automaticly
It's a matter of how you put it together and how you want it to function.
Either you can start from scratch or start looking at some of the customer
files and websites that have free routines and somewhere along the line I
imagine you could paste together a routine to suite your needs.
"Antonio Salazar" <anto...@terra.com.mx> wrote in message
news:38D5B50EFFB78B64...@in.WebX.maYIadrTaRb...
Or, you could prompt the user for the layer name(s) and use the construct
(setq LayName (getstring "\nLayer Name: ")
ss (ssget "x" (list '(0 . "POLYLINE,LWPOLYLINE")(cons 8 LayName)))
)
___
"Antonio Salazar" <anto...@terra.com.mx> wrote in message
news:38D5B50EFFB78B64...@in.WebX.maYIadrTaRb...
I'm trying to edit the TLEN.LSP file so that it ignores lengths
greater than a value I determine (in this case, 200). I tried the
following but get a syntax error message when I try to load it:
(defun C:TLEN2 (/ 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))
(if (< l 200) (tl (+ tl l)) (tl tl))
n (1- n)))
(alert (strcat "Total length of selected objects is " (rtos tl)))
(princ)
)
It seems like I should only have to edit that one line with an if then
statement (if l<200, add l to tl, if not, leave tl alone) but I don't
understand quite enough about the syntax to understand why I keep
getting a syntax error.
After looking in a manual, I've tried several permutations for that
one line such as:
(if (< l 200) (setq tl (+ tl l)) (setq tl tl))
but obviously never got it to work. Can you tell me what I'm doing
wrong?
Thanks,
Brent