@k005 wrote:
.... We can go to the conclusion with P1 P2 P3.
(defun C:ACCT (/ P1 P2 P3 areafull areacorner area); = Area with Corner Cutout Text
(setvar 'dimzin 0); don't suppress trailing zeroes
(setq
P1 (getpoint "\nFirst overall corner: ")
P2 (getpoint P1 "nOpposite overall corner: ")
P3 (getpoint "\nCut-out internal corner: ")
areafull (mapcar 'abs (mapcar '- P2 P1))
areacorner (mapcar 'min (mapcar 'abs (mapcar '- P3 P1)) (mapcar 'abs (mapcar '- P3 P2)))
area (- (* (car areafull) (cadr areafull)) (* (car areacorner) (cadr areacorner)))
); setq
(command "_.text"
"_mc" (mapcar '/ (mapcar '+ P1 P2) '(2 2 2))
"" "" (strcat (rtos (/ area 10000) 2 2) " m²")
); command
(princ)
); defun
If you have the virtual corner inside the column at the cut-out corner to Osnap to, you can use it and the opposite corner, or the other two corners [the ones labeled P1 & P2] -- either combination works, and if that hidden corner isn't there, you can snap to it with APParent-intersection snap.
If there's no cutout, you can pick P3 anywhere on any edge of the rectangular room perimeter.
And it doesn't require Text already there to edit, but puts it in for you [in the current Style on the current Layer].
Kent Cooper, AIA