[FONT=courier new]
(princ "\nc:txta===面积文字累加求和---txtas设置--------lxx.2001.5")
(princ "\ntxtaa===面积文字累加求和'(txtaa 字高 精度 后缀)-----------lxx.2001.5")
;;/;;;
(defun txtadd (/ ss tta i tt pt)
(setq ss (ssget '((0 . "TEXT")) )
tta 0
i 0
)
(repeat (sslength ss)
(setq tt (cdr(assoc 1 (entget(ssname ss i))))
tta (+ tta (atof tt))
i (1+ i)
)
)
(princ "\n累加总和:")(princ tta)
(if (not txtdec) (setq txtdec (getint "\n小数点后位数:")) )
(if (not txthz) (setq txthz (getstring "\n后缀:1-m2/2-米2/3-m/<>:")))
(cond
((= "1" txthz)(setq txthz "m%%132"))
((= "2" txthz)(setq txthz "米%%132"))
((= "3" txthz)(setq txthz "m"))
)
(setq tta (strcat (rtos tta 2 txtdec) txthz)
pt (getpoint "\n标注位置:")
)
(if (not txth) (setq txth (rtos (getdist pt "\n字高:"))) )
(command "text" pt txth "" tta ^c)
)
;;;;;;;;;;;;;;;;;;;;
(defun c:txtas ()
(setq txth (rtos (getdist "\n字高:"))
txtdec (getint "\n小数点后位数:")
txthz (getstring "\n后缀: 1-m2/ 2-米2/ 3-m/<>:")
)
(cond
((= "1" txthz)(setq txthz "m%%132"))
((= "2" txthz)(setq txthz "米%%132"))
((= "3" txthz)(setq txthz "m"))
)
(princ (strcat "\n 字高=" txth " 精度=" (itoa txtdec) " 后缀=" txthz))
(princ)
)
;;;;;;;;;;;;;;;;;;;;
(defun c:txta ()
(princ "\ntxta===面积文字累加求和c:------txtas设置-----lxx.2001.5")
(txtadd)
(princ)
)
;;;;;;;;;;;;;;;;;;;;
;;;;;用法:(txtaa 字高 精度 后缀);;;;;;;;;;eg. (txtaa 300 3 "m%%132");;;
(defun txtaa (txth txtdec txthz)
(princ "\ntxtaa===面积文字累加求和'()-----------lxx.2001.5")
(txtadd)
(princ)
)
;;;;;;;;;;;;
[/FONT]