664571221 发表于 2016-3-26 12:06 
G版你好,能不能改成可以批量框选的
 - (defun c:jzbz (/ e el n n1 str1 str2)
- (if (setq ss (ssget '((0 . "text"))))
- (repeat (setq k (sslength ss))
- (setq e (ssname ss (setq k (1- k))))
- (setq txt (cdr (assoc 1 (setq el (entget e)))))
- (if (and
- (setq n (VL-STRING-SEARCH ")" txt 0))
- (or
- (setq n1 (VL-STRING-SEARCH "x" txt 0))
- (setq n1 (VL-STRING-SEARCH "X" txt 0))
- )
- )
- (progn
- (setq str1
- (rtos (* 0.001 (atof (substr txt (+ 2 n) (- n1 n 1))))
- 2
- 2
- )
- )
- (setq str2 (rtos (* 0.001 (atof (substr txt (+ 2 n1)))) 2 2))
- (command "_copy" e "" "0,0,0" "5000,0,0")
- (entmod (subst (cons 1 str1)
- (assoc 1 (Setq el (entget (entlast))))
- el
- )
- )
- (command "_copy" (entlast) "" "0,0,0" "2000,0,0")
- (entmod (subst (cons 1 str2)
- (assoc 1 (Setq el (entget (entlast))))
- el
- )
- )
- )
- )
- )
- )
- (princ)
- )
|