;V.2.0 copyright 11/4/99 Bill DeShawn ;By Bill DeShawn bdeshawn@prodigy.net ;This is freeware ;Permission granted to distribute ;Permission denied to modify. Inform me. I'll do it. ;Not responsibile for any damage to anybody or anything caused by this code. ;Use at your own risk. ;If you don't get it from me, or from CADSYST, or CADDEPOT, it isn't mine. (defun myerr (msg) (if c:r (c:r) redraw) (setq ent nil elist nil blockname nil fn nil) (setq *error* olderr) (princ msg) (prompt ". Please try again.") (command "_.undo" "end") (princ) ) (defun c:fxblock (/ ent elist blockname fn bname) (command "_.undo" "g") (setq olderr *error*) (setq *error* myerr) (setq ent (entsel "\nSelect the block to fix: ")) (if ent (progn (setq elist (entget (car ent))) (setq blockname (cdr (assoc 2 elist))) (setq fn (findfile (strcat blockname ".dwg"))) ) (progn (setq blockname (strcase (getstring "\nWhat is the block name? "))) (setq fn (findfile (strcat blockname ".dwg"))) ) ) (if (null fn)(setq blockname (strcase (getstring "\nWhat is the block name? ")))) (if (not (null fn)) (setq bname (strcat blockname "=" fn))) (if (not (null fn)) (progn (command ".insert" bname ^c) (terpri) (prompt "\nDone") ) (alert "File not found in file search path. ") ) (if (not (null fn)) (prompt (strcat "\nFile used - " fn))) (setq *error* olderr) (command "_.undo" "end") (princ) )