(defun c:PP ()
(princ “n***(my-style)sumtext***”)
(setq ss (ssget ‘((0 . “text”))))
(setq n -1 sum 0)
(repeat (sslength ss)
(setq n (1+ n))
(setq tno (ssname ss n))
(setq tent (entget tno))
(setq tnum (cdr (assoc 1 tent)))
(setq tcom1 (substr tnum 2 1))
(setq tint1 (substr tnum 1 1))
(setq tcom2 (substr tnum 3 1))
(setq tint2 (substr tnum 1 2))
(if (= tcom1 “,”)
(progn
(setq treal1 (atof (substr tnum 3 3)))
(setq treal2 (atof tint1))
(setq treal (+ (* treal2 1000) treal1))
)
(progn
(if (= tcom1 “.”)
(progn
(setq treal1 (atof (substr tnum 3 3)))
(setq treal2 (atof tint1))
(setq treal (+ (* treal2 1000) treal1))
)
(progn
(if (= tcom2 “,”)
(progn
(setq treal1 (atof (substr tnum 4 3)))
(setq treal2 (atof tint2))
(setq treal (+ (* treal2 1000) treal1))
)
(progn
(if (= tcom2 “.”)
(progn
(setq treal1 (atof (substr tnum 4 3)))
(setq treal2 (atof tint2))
(setq treal (+ (* treal2 1000) treal1))
)
(progn
(setq treal (atof tnum))
))))))))
(setq sum (+ sum treal))
)
(setq sum (rtos sum 2 5))
sum
)
공유