TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: carmi on April 07, 2020, 11:46:05 AM
-
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
-
Have you tried using the standard AREA command? The process you have described is exactly how this command operates.
-
Have you tried using the standard AREA command? The process you have described is exactly how this command operates.
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
-
My $0.05 draw pline
(setq area (vla-get-area (vlax-ename->vla-object (entlast))))
erase pline
-
Hi, this is my 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)
)
Thanks ;)
-
@carmi: Which DwgCAD program do you use?
Your code does not work in BricsCAD, and probably also doesn't work in AutoCAD.
-
@carmi: Which DwgCAD program do you use?
Your code does not work in BricsCAD, and probably also doesn't work in AutoCAD.
I don't know, in Nanocad work perfectly...
-
Do you think is it simple to make a "dynamic" semi-trasparent hatch similar to Area command in Autocad?
-
This Helps U :
(defun c:a ()
(setq s nil)
(setq pli nil)
(setvar "osmode" 0)
(initget (+ 1 16))
(while (setq po (getpoint "\n Point : "))
(setq pli (append pli (list po)))
(setq nn (length pli))
(cond
((> nn 2)
(cond (s (entdel s)))
(setvar "cmdecho" 0)
(command "pline")
(mapcar 'command pli) ;| #apply |;
(command "close")
(setq s (entlast))
(command "area" "object" s)
(princ (getvar "area"))
)
)
)
(princ)
)