请问一下,这个求差时候为何算出来是相反的值?
比如22.5 11.5 求出来是-10,用11.5-22.5=10?
- (defun c:QH (/ en en_data i list1 lst ss txt_add)
- (setq ss (ssget '((0 . "text")(1 . "~*[~--9]*"))))
- (setq i 0)
- (setq lst nil)
- (repeat (sslength ss)
- (setq en_data (entget (setq en (ssname ss i))))
- (setq list1 (cdr (assoc 1 en_data)))
- (setq lst (cons list1 lst))
- (setq i (1+ i))
- )
- (setq txt_add (apply '+ (mapcar 'read lst)))
-
- (command "text" "non" pause "" "" (vl-princ-to-string txt_add) )
- (prin1)
- )
- (defun c:QC (/ en en_data i list1 lst ss txt_add)
- (setq ss (ssget '((0 . "text")(1 . "~*[~--9]*"))))
- (setq i 0)
- (setq lst nil)
- (repeat (sslength ss)
- (setq en_data (entget (setq en (ssname ss i))))
- (setq list1 (cdr (assoc 1 en_data)))
- (setq lst (cons list1 lst))
- (setq -i (1+ i))
- )
- (setq txt_add (apply '- (mapcar 'read lst)))
-
- (command "text" "non" pause "" "" (vl-princ-to-string txt_add) )
- (prin1)
- )
|