 ; QEB - wblock an existing block.
 ; Copyright 1995 by Rocket Software
 ; One gets tired of self-referencing blocks.
 (DEFUN C:QEB (/ entt namm path pnam overwr)
  (setvar "cmdecho" 0)
  (setq entt (entget (car (entsel "Block to wblock: "))))
  (if (= (cdr (assoc 0 entt)) "INSERT")
      (progn
           (setq namm (cdr (assoc 2 entt)))
           (setq path (getvar "dwgprefix"))
           (setq pnam (strcat path namm ".dwg"))
           (princ namm)
           (if (findfile pnam)
               (progn
                    (prompt (strcat "\nFile " pnam " already exists."))
                    (initget 0 "Yes No")
                    (Setq overwr (getkword "\nOverwrite it? <Y>: "))
                    (if (/= overwr "No")
                        (command "wblock" namm "Y" namm)))
               (command "wblock" namm namm)))
      (prompt "\nThat was not a block."))
 (princ))