(defun c:ca( / TEX Q AR PT1 )
(graphscr)
(setvar “cmdecho” 0)
(setq number 0)
(if (and ( = asc nil)( = asc2 nil))(setq asc 1000))
(if (and ( = asc nil)( /= asc2 nil))(setq asc asc2))
(while (setq dum (bpoly (getpoint (strcat “n>> 면적 구할 곳을 피크하세요 <도면스케일 = 1/”(rtos asc 2 0)”>”))))
(command “AREA” “entity” dum)
(setq nu (getvar “AREA”))
(setq nu (* (/ (* asc asc) 1000000) nu)) <—이부분의 숫자를 줄이는건되는데 늘리면 0값이 나오네요
(if ( = number nil)
(setq number 0))
(setq number ( + number nu))
(princ (strcat “면적 ==>”(rtos number 2 2)))
)
(setq AR (rtos number 2 1))
(if (and ( = th nil)( = th2 nil))(setq th 2))
(if (and ( = th nil)( /= th2 nil))(setq th th2))
(setq PT1 (getpoint (strcat “n>> 구한 면적을 텍스트로 써줄 인써트포인트를 피크하세요 <텍스트높이:”(rtos th 2 2)”>…”)))
(command “text” pt1 th “0” ar)
(setq number 0)
(setvar “cmdecho” 1)
)
공유