本帖最后由 ZZXXQQ 于 2014-7-12 08:32 编辑
- (defun C:JH (/ a b a1 b1 a2 b2)
- (if (and (setq a (nentsel "\n选择第一个文本"))
- (setq b (nentsel "\n选择第二个文本"))) (progn
- (setq a2 (ssget (cadr a)))
- (setq b2 (ssget (cadr b)))
- (setq a (entget (car a)))
- (setq b (entget (car b)))
- (setq a1 (cdr (assoc 1 a)))
- (setq b1 (cdr (assoc 1 b)))
- (entmod (subst (cons 1 b1) (assoc 1 a) a))
- (entmod (subst (cons 1 a1) (assoc 1 b) b))
- (if (= (cdr(assoc 0 (entget(setq a1 (ssname a2 0))))) "INSERT")
- (entupd a1)
- )
- (if (= (cdr(assoc 0 (entget(setq a1 (ssname b2 0))))) "INSERT")
- (entupd a1)
- )
- ))
- (princ)
- )
|