(defun c:Test () (setvar "cmdecho" 0) (setq WERT1 (getstring "TEXT1 : ")) (setq WERT2 (getstring "TEXT2 : ")) (command "EINFÜGE" "TESTBLOCK" pause 1 0) (command "ursprung" "l") (setq obj_ename (entlast)) (attchange obj_ename "TEST1" 1 WERT1) (attchange obj_ename "TEST2" 1 WERT2) (princ "\n --------------Ende-----------") );Ende defun Test (defun attchange (elem attname gcwert wert / aslst) (setq aslst (entget elem)) (if (= (cdr (assoc 0 aslst)) "INSERT") (progn (if (= (cdr (assoc 66 aslst)) 1) (progn (setq aslst (entget (entnext (cdr (assoc -1 aslst))))) (while (/= (cdr (assoc 0 aslst)) "SEQEND") (if (= (cdr (assoc 2 aslst)) attname) (progn (if (= (cdr (assoc gcwert aslst)) "") (entmod (subst (cons gcwert wert) (assoc gcwert aslst) aslst ) ;_ end of subst ) ;_ end of entmod (entmod (subst (cons gcwert wert ;(strcat (cdr (assoc gcwert aslst)) ";" wert) ) ;_ end of cons (assoc gcwert aslst) aslst ) ;_ end of subst ) ;_ end of entmod ) ;_ end of if (entupd (cdr (assoc 330 aslst))) ) ;_ end of progn ) ;_ end of if (setq aslst (entget (entnext (cdr (assoc -1 aslst)))) ) ;_ end of setq ) ;_ end of while ) ;_ end of progn ) ;_ end of if ) ;_ end of progn ) ;_ end of if )