(defun wblerr (msg) (if cmde (setvar "cmdecho" cmde)) (if msg (princ msg)) (setq *error* olderr) ) (defun c:wbld (/ fil cmde prefix sset ip) (setq olderr *error* *error* wblerr) (setq cmde (getvar "cmdecho")) (setvar "cmdecho" 1) (setq prefix (getvar "dwgprefix")) (setq fil (getfiled "Write Block to Selected file:" prefix "dwg" 1)) (if fil (setq sset (ssget))) (if fil (setq ip (getpoint "\nInsertion point: "))) (if (and fil (findfile fil)) (progn (command "_.wblock" fil "y" "" ip sset "") (command "_.oops") ) ) (if (and fil (null (findfile fil))) (progn (command "_.wblock" fil "" ip sset "") (command "_.oops") ) ) (if fil (command "_.oops")) (setvar "cmdecho" cmde) (setq *error* olderr) (princ) )