Jump to content

Recommended Posts

Posted

Hello All,

 

Does anyone know how to list the area of a polyline or by points and have the output displayed in acres?

 

Thanks,

Gregg

Posted

A very simple LISP I put together:

 

(defun c:TA (/ ss)
 ;; Total Area of Selected Polylines
 ;; Alan J. Thompson, 03.15.10 / 11.24.10
 (vl-load-com)
 (if (setq ss (ssget '((0 . "*POLYLINE"))))
   ((lambda (area leng)
      (vlax-for x (setq ss (vla-get-activeselectionset
                             (cond (*AcadDoc*)
                                   ((setq *AcadDoc* (vla-get-activedocument
                                                      (vlax-get-acad-object)
                                                    )
                                    )
                                   )
                             )
                           )
                  )
        (setq area (+ area (vla-get-area x))
              leng (+ leng (vla-get-length x))
        )
      )
      (vla-delete ss)
      (textscr)
      (princ (strcat "\nTotal area:\n-----------------\n"
                     (rtos area 2 2)
                     " SF\n"
                     (rtos (/ area 9.) 2 2)
                     " SY\n"
                     (rtos (/ area 43560.) 2 2)
                     " AC.±\n"
                     (rtos leng 2 2)
                     " LF"
             )
      )
    )
     0.
     0.
   )
 )
 (princ)
)

Posted

Thanks for the lisp routine, I love it. Is there a way to put commas in the square foot areas (43560 SF = 43,560 SF)? I'm not familiar with creating or editing lisp routines, so I don't know how hard it is, or should I just be happy with what I have, which I am?

 

Thanks again,

Gregg

  • 2 years later...
Posted

how would you take this out to be more precise?

Posted
how would you take this out to be more precise?

 

Change the second value in each rtos function.

 

eg. (rtos )

eg. (rtos 2 3)

Posted

Beautiful! Thanks for snappy reply.

Posted
Beautiful! Thanks for snappy reply.

 

No problem. You're welcome. :)

  • 6 months later...
Posted

What is the command to utilize this lisp? Thanks in advance!

Posted
What is the command to utilize this lisp? Thanks in advance!

 

TA > (defun c:TA (/ ss)

Posted

(defun c:TA

 

This tells you the command is TA.

Posted

Question has been answered. I just thought I'd log in to say hello. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...