Author Topic: Multiple blocks to files  (Read 1212 times)

0 Members and 1 Guest are viewing this topic.

Fitzandantilus

  • Guest
Multiple blocks to files
« on: October 04, 2016, 11:47:13 AM »
Does anyone know of or have a lisp that will take all the blocks in a single drawings file and extract them to individual files?

I have a single file with all the standards blocks in it and I would like to wblock each block to individual files.

Any help would be appreciated.
 :mrgreen:

ChrisCarlson

  • Guest
Re: Multiple blocks to files
« Reply #1 on: October 04, 2016, 11:51:22 AM »
Code - Auto/Visual Lisp: [Select]
  1. ;;                                                              ;;
  2. ;;              By: Andrea Andreetti                            ;;
  3. ;;                                                              ;;
  4. (defun c:BLE (/ blocklist fextr)
  5. (setq blocklist (ai_table "block" 8))
  6. (setq fextr (acet-ui-pickdir "Select your folder for extraction:" "c:\\" "BLE BlockLIST Extractor"))
  7. (if fextr (progn
  8.       (foreach n blocklist
  9.            (command "._-wblock" (strcat fextr "\\" n) n)
  10.  ))
  11. (alert "Please select a folder.")))
  12. (c:BLE)

danallen

  • Guest
Re: Multiple blocks to files
« Reply #2 on: October 04, 2016, 11:53:43 AM »
tip - in the routine, set current layer to 0, dim & text styles to standard to avoid embedding those items unnecessarily in the block files