Jump to content

perimeter calculation


CAD
 Share

Recommended Posts

You can draw a polygon around each object and do area sq. ftg, in the add mode. It will show you the area and perimeter ftg. You can also join all the polygons, (modify) and total the ftg. that way. I hope this was what you wanted.

Link to comment
Share on other sites

Thanks Chaz, I'm sure it'll do but I need something that lets me select all the polylines then automatically adds up all its lengths.

 

I think I already found what I need (Google did it again!) Here's the lisp I found, i hope it could be useful:

 

;|

 

TLEN.LSP - Total LENgth of selected objects

© 1998 Tee Square Graphics

 

|;

 

(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)

)

 

cya :angewink:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...