(defun c:wt (/ ar pnt utw)
(graphscr)
(setvar "cmdecho" 0)
(setvar "BLIPMODE" 0)
(setq a_area 0)
(prompt "\n < ADD > area :")
(command "area" "e" pause)
(setq PRMT (getvar "PERIMETER"))
(setq a_area (getvar "area"))
(setq s_area 0)
(setq cont 1)
(while (= cont 1)
(setq S (ENTSEL "< SUBTRACT > area : "))
(cond ((null s)
(setq cont 0)
(princ)
)
(T (command "area" "e" S)
(setq narea (getvar "area"))
(setq s_area (+ s_area narea))
)
);; end-cond
);; end-while
(setq t_area (- a_area s_area))
(setq tsize (getvar "textsize"))
(setq pnt (getpoint "\n Writing point : "))
(setq pnt2 (polar pnt (* 1.5 pi) (* tsize 2)))
(setq pnt3 (polar pnt2 (* 1.5 pi) (* tsize 2)))
(setq wt (* t_area 2.7 0.001))
(command "color" "bylayer")
(command "text" pnt "" "" (strcat "Area = " (rtos t_area 2 2) " mm^2" )) => " mm^2")) !!! 띄여쓰기 조심하세요 ^^
(command "text" pnt2 "" "" (strcat "Perimeter = " (rtos prmt 2 2) " mm" )) => " mm"))
(command "text" pnt3 "" "" (strcat "Unit Weight = " (rtos wt 2 3) " Kg/m"))
; (command "text" pnt "" "" (strcat (rtos t_area 2 2)))
; (command "text" pnt3 "" "" (strcat (rtos wt 2 3)))
(command "color" "bylayer")
(princ)
);; end-defun
실행해본 결과 잘 되네요 ^^;;
첫댓글 잘 봤습니다! 감사합니다~~