Author Topic: blocks  (Read 2987 times)

0 Members and 1 Guest are viewing this topic.

BREZI

  • Guest
blocks
« on: August 03, 2004, 07:59:35 AM »
anybody got any lisps that will extract the blocks from a drawing file into wblocks?

hendie

  • Guest
blocks
« Reply #1 on: August 03, 2004, 08:08:17 AM »
try Blockwerx

Quote
Write Block(s) -
Use the BlockWerx write blocks dialog to write any number of blocks in the drawing out to file (into a Library or elsewhere) all at the same time.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
blocks
« Reply #2 on: August 03, 2004, 08:35:09 AM »
try this on a copy of the original dwg first. You will need to create a folder called c:\temp if one does not exist.
Code: [Select]

(defun c:bwblock (/ ss cntr bn)
  (setq ss (ssget "x" '((0 . "INSERT")))
cntr 0
)

  (mapcar 'setvar '(filedia cmddia) '(0 0))

  (if (not (zerop (sslength ss)))
(while (setq ent (ssname ss cntr))
  (setq bn (cdr (assoc 2 (entget ent)))
cntr (1+ cntr)
)
 ;; wblock each block in the current dwg prefixed with "BLOCK_"
 ;; and sent to c:\temp which must exist
 ;(command "_wblock" (strcat "c:\\temp\\BLOCK_" bn) bn "NO"); for Map
 (command "_wblock" (strcat "c:\\temp\\BLOCK_" bn) bn)
 )
)
  (mapcar 'setvar '(filedia cmddia) '(1 1))
  )
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
blocks
« Reply #3 on: August 03, 2004, 09:01:03 AM »
Brian, FYI, when asking for a lisp to be given or when asking for help you may be attempting, the Vlisp Hackers forum is the place for it. Thanks for understanding.

BREZI

  • Guest
blocks
« Reply #4 on: August 03, 2004, 09:01:50 AM »
that's great thanks mark, works a treat!

I have loads to do!!

 :wink: