Rocking with Blocks

9:19 AM Posted In , , , , , , , , , , , , , , Edit This 0 Comments »

First, a little more block theory and then you can rock right into those blocks.

To use a block in a drawing, you need two things: a block definition and one or more block inserts. AutoCAD doesn’t always make the distinction between these two things very clear, but you need to understand the difference to avoid terminal confusion about blocks. (Maybe this syndrome should be called blockheadedness?)

A block definition lives in an invisible area of your drawing file called the block table. (It’s one of those symbol tables that I describe in Chapter 4.) The block table is like a book of graphical recipes for making different kinds of blocks. Each block definition is like a recipe for making one kind of block. When you insert a block, as described later in this chapter, AutoCAD creates a special object called a block insert. The insert points to the recipe and tells AutoCAD, “Hey, draw me according to the instructions in this recipe!”

Although a block may look like a collection of objects stored together and given a name, it’s really a graphical recipe (the block definition) plus one or more pointers to that recipe (one or more block inserts). Each time you insert a particular block, you create another pointer to the same recipe.

The advantages of blocks include:

  • Grouping objects together when they belong together logically. You can draw a screw using lines and arcs, and then make a block definition out of all these objects. When you insert the screw block, AutoCAD treats it as a single object for purposes of copying, moving, and so on.

  • Saving time and reducing errors. Inserting a block is, of course, much quicker than redrawing the same geometry again. And the less geometry you draw from scratch, the less opportunity there is to make a mistake.

  • Efficiency of storage when you reuse the same block repeatedly. If you insert the same screw block 15 times in a drawing, AutoCAD stores the detailed block definition only once. The 15 block inserts that point to the block definition take up much less disk space than 15 copies of all the lines, polylines, and arcs would.

  • The ability to edit all instances of a symbol in a drawing simply by modifying a single block definition. This one is the biggie. If you decide that your design requires a different kind of screw, you simply redefine the screw’s block definition. With this new recipe, AutoCAD then replaces all 15 screws automatically. That’s a heck of a lot faster than erasing and recopying 15 screws!

Blocks are great for convenience and storage savings within a drawing.

Warning Blocks aren’t as great for drawing elements used in multiple drawings, however, especially in a situation where several people are working on and sharing parts of drawings with one another. That’s because blocks, after they get into multiple drawings, stay in each drawing; a later modification to a block definition in one drawing does not automatically modify all the other drawings that use that block. If you use a block with your company’s logo in a number of drawings and then you decide to change the logo, you must make the change within each drawing that uses the block.

tip :External references enable you to modify multiple drawings from the original referenced drawing. You can find out more about external references in the section “Going External,” later in this chapter.

Tip: If all you need to do is make some objects into a group so that you can more easily select them for copying, moving, and so on, use the AutoCAD group feature. Type Group and press Enter to open the Group Manager dialog box. Then select some objects, click the Create Group button, and type a name for the group. Press Ctrl+H to toggle “group-ness” on or off. If you’ve toggled “group-ness” on, picking any object in a group selects all objects in the group. If you’ve toggled it off, picking an object selects only that object, even if it happens to be a member of a group.

Creating block definitions

To create a block definition from objects in the current drawing, use the Block Definition dialog box. (The other way to create a block definition is by inserting another drawing file into your current drawing as a block, which I explain in the next section.) The following steps show you how to create a block definition using the Block Definition dialog box:

  1. Click the Make Block button on the Draw toolbar.

  2. TIP:Layers matter when creating the objects that makes up a block. Block geometry created on most layers retains the characteristics, such as color and linetype, of those layers. But if you create a block using geometry on Layer 0, that geometry has no characteristics, such as color and linetype of its own; chameleon-like, it takes on the features of the layer into which it’s inserted. (If you don’t know what a chameleon is, ask a zoology teacher or a politician.)

  3. Type the block definition’s name in the Name text entry box.

    If you type the name of an existing block definition, AutoCAD replaces that block definition with the new group of objects you select. This process is called block redefinition. AutoCAD first warns you and then updates all instances of the block in the current drawing to match the changed block definition.

    Tip To see a list of the names of all the current blocks in your drawing, pull down the Name list.

  4. Specify the base point, also known as the insertion point, of the block, using either of the following methods:

    • Enter the coordinates of the insertion point at the X, Y, and Z text boxes.

    • Click the Pick Point button and then select a point on the screen. (In this case, use an object snap or other precision technique, as described in Chapter 4, to grab a specific point on one of the block’s objects.)

    The base point is the point on the block by which you insert it later, as I describe in the next section.

    Tip Try to use a consistent point on the group of objects for the base point, such as the lower-left corner, so that you always know what to expect when you insert the block.

  5. Click the Select Objects button and then select the objects that you want as part of the block.

  6. Click a radio button to tell AutoCAD what to do with the objects used to define the block: Retain them in place, Convert them into a block instance, or Delete them.

    The default choice, Convert To Block, is usually the best, because it preserves the pointer to the block definition “recipe.” If you choose Retain instead, AutoCAD leaves the objects on the screen, but as separate objects with no relationship to the block definition.

  7. Click a radio button to choose either Do Not Include An Icon or Create Icon From Block Geometry.

    Go ahead and create the icon; it will help you and others find the right block to use later.

  8. Specify the Insert units to which the block will be scaled in the Drag-and-Drop Units drop-down menu.

    If and when the block is dragged from one drawing into another via the DesignCenter palette (see Chapter 4) or Tool Palette (described later in this chapter), the units you specify here and the units of the drawing you’re dragging into will control the default insertion scale factor.

  9. Enter the block Description.

    Now is the time to think like a database manager and enter a useful description that will identify the block to yourself and others.

  10. Click OK to complete the block definition process.

    If you don’t choose the Convert To Block or the Retain radio button, your objects disappear! AutoCAD has stored the block definition in the current drawing’s block table, however, and the block is ready to use. If you choose the Convert To Block radio button (the default), AutoCAD creates a block insert pointing to the new block definition — the objects look the same on-screen, but now they’re an instance of the block rather than existing as separate objects. If you choose the Retain radio button, the objects remain in place but aren’t converted into a block insert — they stay individual objects with no connection to the new block definition.


Technical Stuff You can include in a block definition a special kind of variable text object called an attribute definition. When you insert a block that contains one or more attribute definitions, AutoCAD prompts you to fill in values for the text fields. Attributes are useful for variable title block information (sheet number, sheet title, and so on) and symbols that contain different codes or call-outs. I describe how to create and use attribute definitions later in this chapter.

Tip Keep your common symbol drawings in one or more specific folders that you set aside just for that purpose. You may want use one of the following techniques to develop a block library of symbols that you use frequently:

  • Create a separate DWG file for each symbol (using WBLOCK, or simply by drawing each one in a new drawing).

  • Store a bunch of symbols as block definitions in one drawing and use DesignCenter to import block definitions from this drawing when you need them.

Inserting blocks

AutoCAD provides a number of ways to insert a block, but the most commonly used and most flexible is the Insert dialog box. Here’s the procedure for inserting a block:

  1. Set an appropriate layer current, as described in Chapter 4.

    It’s a good idea to insert each block on a layer that has something to do with its geometry or purpose:

    • If all the objects in the block definition reside on one layer, then it’s usually best to insert the block on that layer.

    • If the block geometry spans several layers, choose one of them to insert the block on.

    Remember If any of the block definition’s geometry was created on layer 0, then that geometry will inherit the color, linetype, and other object properties of the layer that you insert the block on. It’s like the chameleon changing color to match its surroundings or a politician changing his position to match the day’s opinion polls.

  2. Click the Insert Block button on the Draw toolbar.

  3. Enter the block definition name or external filename by using one of the following methods:

    • Use the Name drop-down list to select from a list of block definitions in the current drawing.

    • Click the Browse button to select an external DWG file and have AutoCAD create a block definition from it.

    You can use an external drawing to replace a block definition in your current drawing. If you click Browse and choose a file whose name matches the name of a block definition that’s already in your drawing, AutoCAD warns you and then updates the block definition in your drawing with the current contents of the external file. This process is called redefining a block — it automatically updates all the block inserts that point to the block definition.

  4. Enter the insertion point, scale, and rotation angle of the block.

    You can either click the Specify On-Screen check box in each area, to specify the parameters on-screen at the command prompt, or type the values you want in the Insertion Point, Scale, and Rotation text boxes.

    Tip Check the Uniform Scale check box to constrain the X, Y, and Z scaling parameters to the same value (which in almost all cases you do).

  5. If you want AutoCAD to create a copy of the individual objects in the block instead of a block insert that points to the block definition, click the Explode check box.

  6. Click OK.

  7. If you checked Specify On-Screen for the insertion point, scale, or rotation angle, answer the prompts on the command line to specify these parameters.

After you insert a block, all the objects displayed in the block insert behave as a single object. When you select any object in the block insert, AutoCAD highlights all the objects in it.

Tip Another way to insert a block is to drag a DWG file’s name from Windows Explorer and drop it anywhere in the current drawing window. AutoCAD then prompts you to choose an insertion point and optionally change the default scale factor and rotation angle. Similarly, you can drag a block definition’s name from the Blocks section of the DesignCenter palette and drop it into the current drawing wi

ndow. (Chapter 4 describes DesignCenter.) New for 2004 AutoCAD 2004 provides one additional way of inserting blocks: the new Tool Palette, which is described in Chapter 2. As is true of using Tool Palette for hatching (Chapter 11), you first must create and configure appropriate tools — that is, swatches. The easiest method is right-clicking a drawing in DesignCenter and choosing Create Tool Palette. A new page is added to the Tool Palette area containing all of the block definitions from the drawing that you right-clicked. Simply click and drag a tool to insert its corresponding block into a drawing. As with hatching, you don’t get the chance to specify a different insertion scale. You also can’t use all of AutoCAD’s precision tools to specify the insertion point precisely, so you may need to move the block into place after inserting it. I recommend that you first master the other block insertion methods described in this chapter — especially the Insert dialog box and DesignCenter palette. Then, if you find yourself inserting the same blocks frequently, conside

r creating a Tool Palette containing them. See “tool palette tools, adding” in the AutoCAD online help system for more information.

Warning Be careful when inserting one drawing into another. If the host (or parent) drawing and the inserted (or child) drawing have different definitions for layers that share the same name, the objects in the child drawing takes on the layer characteristics of the parent drawing. For example, if you insert a drawing with lines on a layer called Walls that’s blue and dashed into a drawing with a layer called Walls that’s red and continuous, the inserted lines on the wall layer will turn red and continuous after they’re inserted. The same rules apply to linetypes, text styles, dimension styles, and block definitions that are nested inside the drawing you’re inserting.

Tip If you need to modify a block definition after you’ve inserted one or more instances of it, use the REFEDIT command (Modifyð Xref and Block EditðEdit Reference In-Place). Look up “REFEDIT” in the AutoCAD online help system.

Attributes: Fill-in-the-blank blocks

You may think of attributes as the good (or bad) qualities of your significant other, but in AutoCAD, attributes are fill-in-the-blank text fields that you can add to your blocks. When you create a block definition and then insert it several times in a drawing, all of the ordinary geometry (lines, circles, regular text strings, and so on) in all of the instances are exactly identical. Attributes provide a little more flexibility in the form of text strings that can be different in each block insert.

For example, suppose that you frequently designate parts in your drawings by labeling them with a distinct number or letter in a circle for each part. If you want to create a block for this symbol, you can’t simply draw the number or letter as regular text using the mText or TEXT command. If you create a block definition with a regular text object (for example, the letter A), the text string will be the same in every instance of the block (always the letter A). Not much help in distinguishing the parts!

Instead, you create an attribute definition, which acts as a placeholder for a text string that can vary each time you insert the block. You include the attribute definition when you create the block definition (as I demonstrate in the “Creating block definitions” section earlier in this chapter). Then, each time you insert the block, AutoCAD prompts you to fill in an attribute value for each attribute definition.

Warning The AutoCAD documentation and dialog boxes often use the term attribute to refer indiscriminately to an attribute definition or an attribute value. I attribute a lot of the confusion about attributes to this sloppiness. Just remember that an attribute definition is the text field or placeholder in the block definition, while an attribute value is the specific text string that you type when you insert the block.

If you’ve worked with databases, the corresponde

nces in Table 13-1 between AutoCAD objects (blocks and attributes) and database terminology may help you understand the concept. Table 13-1: Attribute and Database Comparison AutoCAD Database


Block definition

Database table structure

Block insert

One record in the table

Attribute definition

Field name

Attribute value

Value of the field in one record

Attribute definitions

You use the Attribute Definition dialog box to create attribute definitions (clever, huh?). The procedure is similar to creating a text string, except that you must supply a little more information. Create attribute definitions with the following steps:

  1. Change to the layer on which you want to create the attribute definition.

  2. Choose DrawðBlockðDefine Attributes to run the ATTDEF command.

    The Attribute Definition dialog box appears, as shown in Figure 13-4.
    Figure 13-4: The Attribute Definition dialog box.

    Tip You rarely need to use any of the Mode settings (Invisible, Constant, Verify, or Preset). Just leave them unchecked. If you’re curious about what the modes do, use the dialog box help to find out more.

  3. In the Attribute area, type the Tag (database field name), Prompt (user prompt), and Value (default value).

    Warning The Tag can’t contain any spaces. The Prompt and Value fields may contain spaces.

  4. In the Text Options area, specify the Justification, Text Style, Height, and Rotation.

    The text properties for attribute definitions are the same as those for single-line text objects — see Chapter 9.

  5. Choose the Pick Point button and choose an insertion point for the attribute definition.

    An attribute definition’s insertion point is like a text string’s base point. Remember to use snap, object snap, or another precision tool if you want the eventual attribute values to be located at a precise point.

  6. Click OK to create the attribute definition.

  7. Repeat Steps 1 through 6 for any additional attribute definitions.

    Tip you need to create a series of similar attribute definitions, create the first one using Steps 1 through 6. Then copy the first attribute definition and edit the copy(s) with the Properties palette.

Block definition containing attribute definitions

After you create one or more attribute definitions — and any other geometry that you want to include in the block — you’re ready to create a block definition that contains them. Follow the steps in the section, “Creating block definitions,” earlier in this chapter.

At Step 4 in the section, “Creating block definitions,” select any attribute definitions first before you select the other geometry. Select each attribute definition one-by-one (clicking on each attribute definition rather than selecting multiple attributes with a selection window), in the order that you want the attribute value prompts to appear in the Edit Attributes dialog box (see Figure 13-5). If you don’t select the attributes one-by-one, your block and attributes will still work, but the order of the attribute prompts in the Edit Attributes dialog box may not be what you want.


Technical Stuff You can use the Block Attribute Manager (choose ModifyðObjectðAttributeðBlock Attribute Manager) to re-order the attribute definitions in a block definition. You can also use this dialog box to edit other attribute definition settings, such as the prompt, text style, or layer. If you get tired of traversing four menu picks to get to this command, you can type the command name — BATTMAN (Block ATTribute MANager) — instead. I suppose it’s only a matter of time before Autodesk adds a ROBIN (ReOrder Block INsert) command. . . .

Insert a block containing attribute definitions

After you create a block definition that contains attribute definitions, you insert it just like any other block. Follow the steps in the section, “Inserting blocks,” earlier in this chapter. At the end of the steps, AutoCAD should display the Edit Attributes dialog box, shown in Figure 13-5. The dialog box contains one row for each of the attribute definitions and has any default values filled in. You simply edit the values and then click OK.

Tip The ATTDIA (ATTribute DIAlog box) system variable controls whether AutoCAD prompts for attribute values in a dialog box (ATTDIA=1) or at the command line (ATTDIA=0). If you insert a block and see command line prompts for each attribute value, type a value and press Enter for each attribute value. When you return to the Command: prompt, type ATTDIA, press Enter, type 1, and press Enter again. When you insert blocks with attributes in this drawing in the future, AutoCAD displays the Edit Attributes dialog box instead of prompting you at the command line.

Edit attribute values

After you insert a block that contains attributes, you can edit the individual attributes in that block insert with the EATTEDIT command (Enhanced ATTtribute EDIT — nothing to do with eating). Choose ModifyðObjectðAttributeðSingle and click on any object in the block insert. AutoCAD displays the Enhanced Attribute Editor dialog box with the current attribute values, as shown in Figure 13-6. The most common attribute editing operation is to edit the text value — that is, the text string that appears in the block insert. You can also change properties of the attributes, such as layer and text style.


Technical Stuff Many people use attributes in the way I’ve described so far — as fill-in-the-blank text fields in blocks. But attributes also can serve as data extraction tools. For example, you can export attribute values, such as part numbers and quantities, to a text file, and then import the data into a spreadsheet for analysis or reporting. The Attribute Extraction wizard (ToolsðAttribute Extraction) makes the process fairly straightforward. If you’re hungry to learn more, look up “EATTEXT (Enhanced ATTribute EXTtract) command” in the AutoCAD online help system.

Exploding blocks

The objects in each block insert act like a well-honed marching squadron: If you move or otherwise edit one object in the block insert, all objects move or change in the same way. Usually this cohesion is an advantage, but occasionally you need to break up the squadron in order to modify one object without affecting the others.

To explode a block insert into individual objects, click Explode (the firecracker button) on the Edit toolbar and then select the block insert. When you explode a block insert, AutoCAD replaces it with all the objects — lines, polylines, arcs, and so on — specified in the block definition. You then can edit the objects or perhaps use them to make more block definitions.

Warning Don’t make a habit of exploding blocks cavalierly, especially if you’re working in someone else’s drawing and aren’t sure why the objects are organized as blocks. Most people use blocks for a reason, and if you go around exploding them left and right, you’re likely to be treated the same way that anyone who blows up a lot of things gets treated.

Warning If you explode a block that contains attributes, the attribute values change back to attribute definitions. This usually isn’t the sort of change that you want. If you really need to explode the block insert, you’ll probably want to erase the attribute definitions and draw regular text strings in their place.

0 comments: