Jump to content

Extracting blocks to individual drawing files?


Recommended Posts

Posted

I have a single AutoCAD drawing which has about 200 blocks on. I need to extract these blocks into individual drawing files.

 

Is there a quick way to do this or do I have to wblock each component/block which till take ages?

Posted

Can I ask why you need to extract them to individual files ?

It may make more sense to use Design Center on the file to create a Tool Palette of all the blocks

Posted

I can't take credit... or blame for that matter

;;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))
 )

Posted

Thanks Ipseifert,

 

How do I get that to work? Is is a script?

Posted

ahhh, I see. It's a lisp.

 

Nice one, works a treat! Thanks again.

Posted

Just one more thing I forgot to take into account.

 

All these drawings need to be on a customized template. Can I get them to extract into an individual file using that template?

 

So basically when I open the drawing the drawing has a border.

Posted

Hi,

 

Can anyone help with this?

 

I can now (thanks to lpseifert's help!) extract all the blocks into individual files, but I need them all to have the settings and border as my standard template. Is this possible without having to open each drawing and paste onto a template?

Posted

You can import the template (Layout) thru DesignCentre, in each drawing.

I do not know an easier way.

Posted
You can import the template (Layout) thru DesignCentre, in each drawing.

I do not know an easier way.

 

Yeah I know this but when I insert the tempate the parts list/BOM is not picking up the tag.

 

I should note I am working with AutoCAD Mechanical 2008.

 

Thanks.

Posted
Can I ask why you need to extract them to individual files ?

It may make more sense to use Design Center on the file to create a Tool Palette of all the blocks

 

Hi mate,

 

I need them as individual blocks so I can check them into Productstream. Each block must be signed off with it's own drawing border.

 

I have about 3000 blocks (all in one drawing) to extract into individual files with their own drawing border on the layout. I'm just trying to cut a few corners.

Posted

Ste I would suggest you try a new thread in the Lisp/ VBA... forum, there might be someone there who can play around with the lisp you've been given :wink:

 

I don't think the fact you're using Mechanical will matter but for future reference you might want to update your profile (currently showing as ACAD 2007)- people will generally notice this.

Posted

Thats GE13579, Will do.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...