I tried to add in a save as function...
but it doesn't work the same as WBLOCK:
;;; --------------------------------------------------------;;
;;; MWBLOCK.LSP (Multiple WBlock)
;;; English translated
;;; --------------------------------------------------------;;
(defun BLOCK_LIST (/ DBL LBL)
(vl-load-com)
(while
(setq DBL (tblnext "BLOCK" (not DBL)))
(if
(/= "*" (substr (DXF 2 DBL) 1 1))
(setq LBL
(append LBL (list (DXF 2 DBL)))
) ;_ end of setq
) ;_ end of if
) ;_ end of while
(if LBL
(setq LBL (acad_strlsort LBL))
(alert "You have not any blocks in a drawing ")
) ;_ end of if
(if LBL
LBL
NIL
) ;_ end of if
) ;_ end of defun
;;;
;;;
;;;
(defun C:MBL (/ FIRSTNAME LBL PTH itm CMD INC)
(setq INC 0
LBL (BLOCK_LIST)
) ;_ end of setq
(if
(= NIL LBL)
(princ "\nNothing to do. ")
(progn
(setq FIRSTNAME
(getfiled "Select Export Directory" (car LBL) "dxf" 15)
) ;_ end of setq
(if FIRSTNAME
(progn
(setq PTH (car (fnsplitl FIRSTNAME)))
(setq CMD (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(foreach itm LBL ;; For every 'itm' in the list given by 'LBL'
(vla-saveas
(vla-get-activedocument (vlax-get-acad-object))
(strcat PTH itm ".dxf") ac2010_dxf
)
(setq INC (1+ INC)
)
) ;; end foreach
(setvar "CMDECHO" CMD)
)
(princ "\nDone")
)
)
)
(if PTH
(alert
(strcat "\nSaved "
(itoa INC)
" blocks in selected directory "
(strcase PTH)
)
)
)
(princ)
) ;_ end of defun
(princ)
(princ "\n Export All blocks in Drawing - MBL.")
(princ)
(c:mbl)
The above gives me the same dxf file containing all the blocks as opposed to individual dxf files with one block only... hilarious