Hi everyone Iv'e written a lisp routine which might seem primitive to some. This is what I want to happen.... I want the routine to perform an operation "txtfr" which will format the text of all dimension entities on the drawing to a customized font and then exit the progar "quietly". As it stands every time I rum the program I will get an error message following the execution of the program. The program works perfectly the first time, with the exception of the error message, but on subsequent attempts, I have to run the program twice in order for it to take effect. I am quite new at using the "while" and "if" logic combination in a program and am wondering if there might be something wrong here. Can anyone help? ;chdim written by Chuck Fluri 20/10/04 ;converts dimension text to a formatted text string (defun c:chdim () (setq ent1 (entnext)) ;sets the entity to the first entity in the table (while (/= nil ent1) ;checks to see if the end of the table has been reached (progn (setq entype (cdr (assoc 0 entlist)) ;defines the entity type ) (if (= entype "DIMENSION") ;if the entity is a dimension... (progn (setq entlist (entget ent1) ;creates a list of the entity codes dimlen (cdr (assoc 42 entlist)) ;retrieves the dimension length reptxt (txtfr dimlen) ;converts the dimension length to a formatted string arxcode (cons 1 reptxt) ;constructs the new code for the dimension string ) ;setq (setq entlist (subst arxcode (assoc 1 entlist) entlist) ;replaces the formated string code for the the existing one ) ;setq (entmod entlist) ;updates the data base ) ;progn ) ;if (setq ent1 (entnext ent1) ;procceed to the next entity entlist (entget ent1) ;constructs the new list of codes ) ;setq ) ;progn ) ;while (setq ent1 nil) ;sets the entity to nil (princ) ;exit quietly ) ;defun