Seite 1 von 1

suchen-ersetzen

Verfasst: Do 3. Feb 2005, 13:03
von CADwiesel

Code: Alles auswählen

(defun C:su_er ( / )
  (if (setq as(ssget "_X" '((0 . "MTEXT"))))
    (mapcar '(lambda (x)
               (setq elem(entget x))
               (if(wcmatch(cdr(assoc 1 elem))"*\\S*")
               (cond
                 ((equal (substr(cdr(assoc 1 elem))1 3)"\\A2")
                 (setq elem(subst (cons 1 (strcat "\\A1"(substr(cdr(assoc 1 elem))4)))(assoc 1 elem)elem))
                 (entmod elem)
                 )
                 (T
                 (setq elem(subst (cons 1 (strcat "\\A1;"(cdr(assoc 1 elem))))(assoc 1 elem)elem))
                 (entmod elem)
                 )
                 )
               )
               )
    (bau_elemli as)
    )
    )
  )
      (defun bau_elemli (asatz / n elemli)
  (setq n 0)
  (repeat (sslength asatz)
    (setq elemli (cons (ssname asatz n) elemli)
          n      (1+ n)
          ) ;_ end of setq
    ) ;_ end of repeat
  elemli
  ) ;_ end of defun