Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Area of multiple objects

3 REPLIES 3
Reply
Message 1 of 4
sports7
502 Views, 3 Replies

Area of multiple objects

Im looking for a Lisp that will give me the Area of multiple objects in SqFt.
3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: sports7

Try a Search -- I'm pretty sure the same or very similar subject has come up before.  I know there are things to total the areas of multiple objects, and there must be things to report areas in square feet, though there may not be something with exactly what you're after, so it may take some combining.

Kent Cooper, AIA
Message 3 of 4
daneson.marcelino
in reply to: sports7

hello,

 

i created a routine which allows you to select a closed plines and alerts the total area of it.

hope it works on you.

 

have a good day 🙂

Message 4 of 4
daneson.marcelino
in reply to: sports7

;;;alert the total area of a close polylines in square meter and square feet
;;;created by daneson.marcelino upon request by blogger

(defun c:tarea ()
(setvar "INSUNITS" 6)
(setvar "CMDECHO" 0) ;setting drawing units into meters
(setq c_pline (ssget (list (cons 0 "LWPOLYLINE") (cons 70 1)))) ;sorting all closed polylines
(setq c_no (sslength c_pline)) ;number of sorted closed pline
(setq ct 0) ;setting counter
(setq m2f 10.7639) ;conversion of sqm to sqf
(setq areas (list))

(repeat c_no
(setq p_name (ssname c_pline ct))
(command "area" "o" p_name)
(setq p_area (getvar "area"))
(setq areas (append areas (list p_area)))
(setq ct (+ ct 1))
)

(setq total_area_sqm (apply '+ areas))
(setq total_area_sqf (* total_area_sqm m2f))

(alert (strcat (strcat "area in sqm=" (rtos total_area_sqm)) "\n" (strcat "area in sqf=" (rtos total_area_sqf))))

(setvar "CMDECHO" 1)
(progn (princ))

(textscr)
(princ "created by: daneson.marcelino@gmail.com")
(princ)
);;end of function

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost