I've added program while on my code,but it program can not display,what wrong in my lisp,can somebody help me,thanks Best regards Ade Suharna ; Regis is Registration of drawing from drawing sheet to database (under construction) ; Design by Ade Suharna ; March 24, 2004 ; Edit by Ade Suharna 13 July 2004 ; Ade Suharna 04 August 2004 1). (defun c:reg() (setq oldosmode (getvar "osmode")) ; get osmode setting (setvar "osmode" 0) ; osmode set to 0 (setq oldcmdecho (getvar "cmdecho")) ; get cmdecho setting (setvar "cmdecho" 0) ; cmdecho set to 0 (vl-load-com) ; to automatic call (while (setq loc (entsel "\CLICK TEXT WOULD YOU CHANGE: ") deg (getstring "\nENTER NEW TEXT FOR REPLACE IT: " T)); 1). (progn (setq tex "TEXT" listpos (entget (car loc)) degpos1 (cdr (assoc 1 listpos)) texs (cdr (assoc 0 listpos))) (if loc (cond ((/= tex texs)(princ "YOUR CHOOSE OBJECT INVALID")) ((= tex texs) (progn (setq degpos2 deg) (setq ed (subst (cons 1 degpos2) (assoc 1 listpos) listpos)) (entmod ed) (entupd listpos) ))))loc)) (setvar "osmode" oldosmode) ; return setting (setvar "cmdecho" oldcmdecho) (princ) )
;Hi, Ade! ;I'd check error and correct your prog: (defun c:reg() (setq oldosmode (getvar "osmode")) ; get osmode setting (setvar "osmode" 0) ; osmode set to 0 (setq oldcmdecho (getvar "cmdecho")) ; get cmdecho setting (setvar "cmdecho" 0) ; cmdecho set to 0 (vl-load-com) ; to automatic call ;|(vl-load-com) useless in current routine|; (while (setq loc (entsel "\CLICK TEXT WOULD YOU CHANGE: ") deg (getstring "\nENTER NEW TEXT FOR REPLACE IT: " T)); 1). (progn (setq tex "TEXT" listpos (entget (car loc)) degpos1 (cdr (assoc 1 listpos)) texs (cdr (assoc 0 listpos))) (if loc (cond ((/= tex texs)(princ "YOUR CHOOSE OBJECT INVALID")) ((= tex texs) (progn (setq degpos2 deg) (setq ed (subst (cons 1 degpos2) (assoc 1 listpos) listpos)) (entmod ed) (entupd (car loc));error breakpoint ;|AcadHelp: (entupd en) ; Regenerates !entity!/text entity is (car loc))|; ))))loc)) (setvar "osmode" oldosmode) ; return setting (setvar "cmdecho" oldcmdecho) (princ) ) (c:reg) ;By the way, this likes me more: (while (setq en (car (entsel))) (command "_.select" en "") (command "_.ddedit" en "" pause "" "") );voila' ;;;Best regards, ;;;Fatty