Monday, July 19, 2004

AutoCAD Blocks


Do you use acad blocks? Do you use the same blocks in multiple drawings? Ever need to update the blocks?

If you answered yes to any of the above questions then this posting is for you. I recently gave a refresher/updated materials course for a few AutoCAD users and part of this involved different methods of using blocks and redefining existing definitions in different drawings. If you need to accomplish this here are a few examples of ways to accomplish this:

1. The ability to have a block in a drawing and manipulate the block(s) by redefining/changing all instances can be done with the refedit command, or by recreating the block and using the same block name. This will update all the blocks in the current drawing of the same name.

2. If you are defining your linework for an object to become a block in an external file you can use the "insert" command with the browse option to choose the external file to override blocks in your drawing of the same name. If this is not working the most likely issue is that the file was wblocked out as a block to a file of the same name. If so explode the block in the external file to simple linework and purge the block from this drawing and save the file. The insert command>>browse option will now insert the file as desired.

3. If you are wblocking information out to an external file or block library as blocks and not linework you can use DesignCenter (Ctrl + 2) to redefine blocks in your drawing. To accomplish this open DesignCenter and browse using the folder tab to the file and expand the sub-files and select the blocks option. Nowright click the block you wish to redefine in your current file and choose "Redefine only" to update the block definition. You can use the "Ctrl + Tab" and/or "Ctrl + Shift + Tab" key combinations to cycle through open drawings and repeat as needed.

4. Of course for those of you who would rather type, script or use lisp you can still use the alternative -insert with the = option (-insert , ExistingBlockname=path of drawing and FileName, choose "yes" to redefine the existing blocks in the drawing).
Example -insert, MyBlock=C:\WorkingFiles\MyBlock.dwg which will replace all instances of the block "MyBlock" with the information from the drawing "MyBlock.dwg". This is very similar to Step 2 above and has the same limitations of requiring linework only in this file.

*5. Of course you could always use a small bit of lisp code to swap one block out for another, courtesy of David.

(defun c:SWAPBLK (/ SELECTIONSET COUNT NBLK BLOCK ELIST)
(princ "\n SWAPBLK")
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(prompt "\nSelect blocks to be swapped to another:")
(setq SELECTIONSET (ssget) COUNT 0)
(setq NBLK (getstring "\nName of swapping block:"))
(repeat (sslength SELECTIONSET)
(setq BLOCK (ssname SELECTIONSET COUNT))
(setq ELIST (entget BLOCK))
(setq ELIST (subst (cons 2 NBLK)(assoc 2 ELIST) ELIST))
(entmod ELIST)
(entupd BLOCK)
(setq COUNT (+ COUNT 1))
)
(princ)
)
(princ "\nSWAPBLK loaded.")
(princ)


This should help you to understand a few of the many ways to use blocks more effectively in AutoCAD.

Happy cadding...

5 comments:

Anonymous said...

Of course, this discussion is not complete without addressing the updating of ADT MVB's and their associated view blocks. As most of us know, updating the MVB style definition with new embedded view blocks will not update its associated AutoCAD view blocks. The view bocks have to be updated with one of the techniques you’ve so nicely outlined. In the past, I have scripted this process as you’ve suggested across many drawing files in a project using ScriptPro. However, since then, I’ve taken up a new technique for updating my MVB’s. I redefine the view bocks with a slightly different name. For example each of the view blocks such as GHTY-00_M, GHTY-00_P are given new names like GHTY-01_M and GHTY-01_P. This way I’m not left with the task of updating the individual view blocks after the MVB has been updated. Unfortunately I can’t automate the update of the MVB’s across multiple drawings with a script. The only solution, short of writing my own routine, has been to use John Janzen’s ADT Standards Manager www.cadmin.com .

Beau Turner on 4:31 PM said...

Thanks for the comment. This was more focused using straight ACAD than the verticals, but the use of ADT MVB's should still uses the same rules for updating the blocks.

I am using ADT2005 in this example:
1. Create a new block (rectangle) called "Box".
2. Create a new MVB called "MVB_Box" use the block definition "Box" for the View Block.
3. Add several instances of the "MVB_Box" MVB to your drawing.
4. Save your drawing (Drawing1.dwg for a quick test).
5. Start a new drawing and copy your MVB's from Drawing1.dwg and save as Drawing2.dwg.

Now refedit the block definition "Box" in Drawing 1 (I made the rectangle into an envelope). All the MVB's using this block updated automatically.

Using DesignCenter you can update the block definition using the right click method mentioned in the post to redefine the block definition. Until the block definition gets redefined the MVB's will not change.


make sense? =)

Anonymous said...

Thanks for including the command line method of redefining a block to itself. Works well and I for one am a Command Line User and "LISPER".

Anonymous said...

I’ve used several types of auto cad blocks and have been fairly happy with those that I’ve used. I do like your tips though on the different ways of using ACAD’s. Working for the company I’m with I tend to get pigeon holed into one method and one set of tools. It’s refreshing to see your number 4 tip too. I am one of those people who prefers to type and script so I found your suggestion there very insightful. I’ll try a few of your suggestions out and come back to let you know how it works out for me.

Anonymous said...

I too use ADT2005 and have had to update not just my basic blocks but my MVB’s too. This guy definitely makes some excellent points about needed to and actually updating an auto cad block though he did forget to mention the need to update other aspects of your programs as well. These kinds of updates however are useless unless you update your style definitions as well.

 

Copyright 2009 All Rights Reserved Beau Turner Triple D Design, LLC | Template design by Brian Gardner | Converted to Blogger Template by Bloganol dot com