- 积分
- 167
- 明经币
- 个
- 注册时间
- 2002-8-5
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
今天偶入论谈,收获很多,我也写个小程序跟大家一起分享吧!
;;;time:August 5,2002
;;;draft:changshilong
;;;describe: The little process can provide the multiply result of two or more real numbers string in the drawing.
(defun C:multiply(/ ab a b text ssum p1 p x y)
(print)
(print)
(prompt "选择求积数据....")
(setq AB (SSGET '((0 . "TEXT"))))
(setq i 0)
(setq ssum 1)
(if (NOT (= ab nil))
(progn
(while (< i (sslength ab))
(setq b (ssname ab i))
(setq a (entget b))
(setq TEXT (assoc '1 a))
(setq TEXT (cdr text))
(if (and (< (ascii text) 58) (> (ascii text) 47))
(setq ssum (* ssum (atof text)))
)
(setq i (+ 1 i))
)
(setq ssum (rtos ssum 2 1))
(prompt "Total = ")
(prin1 ssum)
(print)
)
)
(setq p (getpoint"\n数据积写入点:"))
(setq x (car p))
(setq y (cadr p))
(setq p1 (list (+ 1.5 x) (+ 0.9 y)))
(COMMAND "text" p1 3.5 0 ssum)
);;over
请多指教!!changshilong |
|