Code Red > AutoLISP (Vanilla / Visual)

Draw polyline and get area value

(1/2) > >>

carmi:
Hi all,
I only found lisp code that return the area value of an existing boundary if you click an internal point.

I am looking for a lisp that allows, first to draw the boundary with a polyline and then return the area value of this boundary and, after get area value, automatically delete boundary.

Anyone help me?
Thank you

Lee Mac:
Have you tried using the standard AREA command? The process you have described is exactly how this command operates.

carmi:

--- Quote from: Lee Mac on April 07, 2020, 02:32:32 PM ---Have you tried using the standard AREA command? The process you have described is exactly how this command operates.

--- End quote ---
Yes, I know but I not have Autocad but another cad with another area command. I search a lisp similar to area command of Autocad.
Thank you

BIGAL:
My $0.05 draw pline

(setq area (vla-get-area (vlax-ename->vla-object  (entlast))))

erase pline

carmi:
Hi, this is my code:


--- Code: ---(defun c:ap (/ area e1 text)
     
      (command "PLINE" )
  (setq area (vla-get-area (vlax-ename->vla-object  (entlast))))
  (setq e1 (entlast))
  (command "-ERASE" e1 "")
      (princ "\nArea: ")
  (princ (rtos area))
  (vl-load-com) (princ)

    )

--- End code ---

Thanks ;)

Navigation

[0] Message Index

[#] Next page

Go to full version