Ste1978 Posted April 9, 2009 Share Posted April 9, 2009 I was kindly given this code which extracts all blocks from a drawing into individual drawing files. However, the only problem is that the individual blocks are exploded when I open the drawing file whereas when they were in the original file they were not exploded. I need to tweak this code somehow so that the block remains unexploded, this way I can browse to them through Design Centre. Can anyone help? ;;Make individual dwgs from all the blocks in a drawing ;; By Mark S. Thomas (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)) ) blocks.lsp Quote Link to comment Share on other sites More sharing options...
Ste1978 Posted April 14, 2009 Author Share Posted April 14, 2009 Oh dear, no replies :-( Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted April 14, 2009 Share Posted April 14, 2009 Umm it is doing a write block, which means it saves the the items in a new dwg, because a block is simple a dwg inserted in to a block. hope it makes sence Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.