Instead of one file, break them into categories with a file for each type of block. That way a damaged file won't trash the entire library. That will also make it easier to import the blocks by file into tool palettes.
As for inserting them into one file, the lisp below works, but it places all the blocks at 0,0.
There is a line in this function that loads DOSLIB
(arxload "N:/ACAD2015/CS/DOSLIB/doslib20x64.arx")
You'll need to download the version of DOSLIB that matches your version of AutoCAD from HERE.
Then you'll need to edit that line to match the location of the file for loading.
;;;;;;;============================================
;;;;;Main Error Handler
;;;;;;;============================================
(defun *xoerr* (s)
(if (/= s "Function cancelled")
(if (= s "quit / exit abort")
(princ)
(princ (strcat "\nError: " s))
)
)
(setq S nil)
(if OLDECHO
(setvar "cmdecho" OLDECHO)
)
(if OLDLAY
(setvar "clayer" OLDLAY)
)
(setq *error* *err_old*
*err_old* nil
)
(princ)
)
;;
;;;;;;;============================================
;;;;;Main Osmode Handler
;;;;;;;============================================
(defun XT_SWT_OSMODE (SWT_XT_OO /)
(if (= SWT_XT_OO "ON")
(progn
(if (< 5000 (getvar "osmode"))
(setvar "osmode" (- (getvar "osmode") 16384))
) ;if
) ;progn
(progn
(if (> 5000 (getvar "osmode"))
(setvar "osmode" (+ (getvar "osmode") 16384))
) ;if
) ;progn
) ;if
) ;defun
;;
;;;;;;;============================================
;;;;;Sets attatch type to Attach then runs DOINSERT
;;;;;;;============================================
(defun c:inslist () (command "undo" "begin")(DOinsert)(command "undo" "end"))
;;;;;;;;;============================================
(defun DOinsert (;/ OLDECHO OLDLAY
; CAPT_TITLE DEF_PATH IPOINT XSCALE YSCALE
; ROT FNAME FLIST DWG_PATH CMTDCLPATH
)
(COMMAND "UCS" "WORLD")
(osmget)
(XT_SWT_OSMODE "OFF")
(setq *err_old* *error*
*error* *xoerr*
)
(setq OLDECHO (getvar "cmdecho"))
(setq OLDLAY (getvar "clayer"))
(setvar "clayer" "0")
(setq CAPT_TITLE (strcat "Select files to Insert"))
(setq DEF_PATH (getvar "DWGPREFIX"))
(arxload "N:/ACAD2015/CS/DOSLIB/doslib20x64.arx")
(setq FLIST
(dos_getfilem CAPT_TITLE DEF_PATH "Drawing Files (*.DWG)|*.DWG")
)
(if FLIST
(progn
(setq IPOINT "0,0")
(setq XSCALE 1)
(setq YSCALE XSCALE)
(setq ROT 0)
(setq DWG_PATH (nth 0 FLIST))
(vl-load-com)
(setq FLIST (vl-remove DWG_PATH FLIST))
(foreach FNAME FLIST
(progn
(command "-insert" (strcat DWG_PATH FNAME) "xs" "1" "r" "0" "0,0,0")
(princ
(strcat FNAME " was successfully inserted.\n")
)
) ;progn
) ;foreach
) ;progn
(princ "\nNo files selected.")
) ;if
(setq *error* *err_old*
*err_old* nil
)
(setvar "clayer" oldlay)
(XT_SWT_OSMODE "ON")
(osmret)
(COMMAND "UCS" "PREV")
(princ)
)
(defun c:ins () (c:inslist))
(princ)