(defun c:q( / 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))
(if ( = number nil)
(setq number 0))
(setq number ( + number nu))
(setq AR (strcat (rtos number 2 1) “0”))
(princ (strcat “면적 ==>”ar))
)
(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)
)
이리습을 쓰고 있는데여 소수점 나오는 면적은 괜찮은데 정수로 나오는 면적은 0이 붙어서 나오네여…
정수로 나올때 .00 이 붙어서 나오게 하는 방법 없나여?
ex) 9.00 이 나와야 하는데 90 이라고 적힘
공유