如果Op是指字符串而不是高度。
- (defun c:Test (/ ss i e)
- (if (and
- (tblsearch "LAYER" "text3.5")
- (tblsearch "LAYER" "text5")
- )
- (if (setq ss (ssget "_X" '((0 . "*TEXT") (-4 . "<OR") (1 . "3.5mm") (1 . "5mm") (-4 . "OR>"))))
- (repeat (setq i (sslength ss))
- (setq e (entget (ssname ss (setq i (1- i)))))
- (if (eq (cdr (assoc 1 e)) "3.5mm")
- (entmod (subst (cons 8 "text3.5") (assoc 8 e) e))
- (entmod (subst (cons 8 "text5") (assoc 8 e) e))
- )
- )
- )
- (princ "\n one or the two layers are not found in the drawing ")
- )
- (princ)
- )
|