[原创]写个小程序跟大家一起分享
今天偶入论谈,收获很多,我也写个小程序跟大家一起分享吧!;;;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
厉害!
兄弟,我也对这个很感兴趣,交个朋友?
页:
[1]