;from Barr Doug;Re: Block to Wblock routine ;A short routine follows. Drawings go in same directory you're currently in. ;-doug
;"Jod" <jodwithay@c4.com> wrote in message ;news:C4B1C2C1406087ED3C4AB6340F78868D@in.WebX.maYIadrTaRb... ;> Does anyone out there have a routine that will take all of the blocks in a ;> drawing and wblock them to a file of the same name? Any help would be ;> appreciated. TIA.
(defun C:writeblk () (setvar "cmdecho" 1) (setq dir (getvar "dwgprefix")) (setq b (cdr (assoc 2 (tblnext "block" T)))) (while (= "*" (substr b 1 1)) (setq b (cdr (assoc 2 (tblnext "block")))) ) (setq bs (substr b 1)) (setq bs (strcat dir bs)) (command "-wblock" bs b) (setq count 1) (while (setq b (cdr (assoc 2 (tblnext "block")))) (while (= "*" (substr b 1 1)) (setq b (cdr (assoc 2 (tblnext "block")))) ) (setq bs (substr b 1)) (setq bs (strcat dir bs)) (command "-wblock" bs b) (setq count (1+ count)) ) (setq count (rtos count 2 0)) (setq count (strcat count " .dwg files created from blocks. ")) (princ count) (princ) )