Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Книги_AutoCad_2 / AutoCAD 2006 and AutoCAD LT 2006 Bible_2004г__.pdf
Скачиваний:
142
Добавлен:
09.04.2015
Размер:
17.83 Mб
Скачать

522 Part III Working with Data

Combining Objects into Blocks

Any object or set of objects can be saved as a block. Creating a block is easy, but a little planning makes using it much simpler. Before you create a block, you need to understand how blocks are inserted and how you want to use the specific block that you’re creating.

Understanding base points and insertion points

Figure 18-1 shows the legend for a plat drawing. Each legend symbol is a block that is then inserted in the drawing as needed. A symbol has been selected, and you can see that it has one grip at the base point. The base point is the point that you use to insert the block. Every block must have a base point. When you insert the block, the base point is placed at the coordinate that you specify for inserting the block — the insertion point. All of the objects of the block are then inserted in their proper place relative to that insertion point.

Block

Base point

Figure 18-1: Each legend symbol is a block. Every block has a base point.

The base point does not have to be on the object, but it should be in a location that makes it easy to insert the block. Figure 18-2 shows a different sort of block, a title border/block. In this case, the base point is usually inserted at 0,0 of the drawing. By placing the base point at the lower-left corner of the border, you can easily place this block in any drawing. The base point is similar in concept to the justification point on text objects.

Chapter 18 Working with Blocks and Attributes

523

Block

Base point

Figure 18-2: This title block is a block. Its base point is at the lower-left corner.

Creating a block

To create a block, first create the objects just as you want to save them. You may include other blocks as objects in your block. (A block within a block is called a nested block.)

After you’ve created the objects for your block, follow these steps:

1.Choose Make Block from the Draw toolbar to start the BLOCK command and open

the Block Definition dialog box, shown in Figure 18-3. The dialog box guides you through the process of defining a block.

Figure 18-3: The Block Definition dialog box.

2.In the Name text box, type a name for the block. The name can be up to 255 characters, and spaces are allowed.

524 Part III Working with Data

3.Click Select Objects. You return to your drawing temporarily. Use any selection method to select the objects that you want in your block. Press Enter to end selection and return to the Block Definition dialog box. (If you select the objects before starting the command, you skip this step. The dialog box notes how many objects are selected.) To filter out the selected objects, choose Quick Select, as described in Chapter 10.

4.Choose a base point. By default, the base point is 0,0 (or 0,0,0 for 3D drawings). To define any other point, such as an object snap on any of the objects in the block, click Pick Point. You return to your drawing temporarily. At the Specify insertion base point: prompt, specify a point, which returns you to the dialog box.

Caution

For precision, you should always use an object snap when defining the base point. If the

 

base point that you need to use is not on any object, you can use the From object snap,

 

tracking, or some other means of specifying a precise coordinate.

5.Choose how you want the objects of the block to be treated:

If you want to keep the objects that you selected as individual objects, select Retain.

To convert the objects to a block, select Convert to block.

If you created the objects to insert them elsewhere and do not need the original objects, select Delete.

6.Choose the insert units that you want to use when defining your block. (You can choose anything from microns to parsecs!) Let’s say you work in kilometers and save a block with an insert unit of kilometers. When you insert a block, it will be measured in kilometers, rather than millimeters or inches. If the units aren’t important to you, you can specify the units as Unitless.

New

The Scale Uniformly and Allow Exploding check boxes, covered in the next two items, are

Feature

new for AutoCAD 2006 and AutoCAD LT 2006.

 

7.Check the Scale Uniformly check box to force any scaling of the block to scale at equal X and Y factors. This feature prevents distortion of the block. By default, this option is not checked.

8.The Allow Exploding check box lets you explode the block after you insert it. This option is checked by default.

9.If you want, enter a description for the block. The description is used by the DesignCenter. You can also add a hyperlink by clicking the Hyperlink button. (See Chapter 28 for more on hyperlinks.)

10.Check the Open in Block Editor check box if you know that you want to create a dynamic block. (I explain dynamic blocks later in this chapter.) When you click OK to close the dialog box, the Block Editor immediately opens. (This feature is not available in AutoCAD LT.)

11.Click OK to return to your drawing.

The definition of the block is now stored in the drawing, ready for you to insert as many times as needed. If you selected Delete, your objects disappeared. You can retrieve them by the one command with a sense of humor: OOPS. The OOPS command restores the last object or set of objects that you erased. This command works whether you used the ERASE command or created a block, and even if you used some other command in the meantime. By contrast, UNDO undoes almost all commands, but only in the order that they were executed.

Chapter 18 Working with Blocks and Attributes

525

Tip

If you create a number of block definitions that you don’t end up using in the drawing, use

 

the PURGE command to delete them. This reduces the size of the drawing file.

Redefining a block

One advantage of deleting the objects is that their disappearance confirms that you selected the right objects. If you make a mistake, or if you want to change the block in some way, you can redefine it. If you just created the block, use UNDO and make any necessary changes. If you created the block earlier, follow these steps:

1.Insert the block and explode it. (Exploding is covered later in this chapter.)

2.Make the desired changes and repeat the process of defining the block, using the same name for the block.

Caution

When you specify the name of the block, you should type it, rather than choose it from the

 

Name drop-down list. Choosing the name from the list replaces selected objects that you

 

wanted to be in the new version of the block with the objects from the previous block defi-

 

nition, and sets the insertion point to 0,0.

3. Click Yes when the message asks whether you want to redefine the block.

Redefining a block that has been inserted in your drawing updates all of the blocks in that drawing. This is a powerful technique to control your drawing. If you have repetitive symbols in your drawing, it’s worthwhile to make blocks out of them just so that you can make this type of global change if necessary.

On the

The drawing that you need for the following exercise on creating a block, ab18-a.dwg, is in

CD-ROM

the Drawings folder on the CD-ROM.

STEPS: Creating a Block

1.Open ab18-a.dwg from the CD-ROM.

2.Save the file as ab18-01.dwg in your AutoCAD Bible folder. This is a small portion of an electrical schematic drawing, as shown in Figure 18-4. OSNAP should be on. Set running object snaps for endpoint, quadrant, and intersection.

1

Figure 18-4: A portion of an electrical schematic.

3. To make a block of the 1.5-amp fuse, choose Make Block from the Draw toolbar.

526 Part III Working with Data

4.In the Name text box of the Block Definition dialog box, type 1-5 amp fuse.

5.Click Select objects to return to the drawing temporarily.

6.Select the boxed objects shown in Figure 18-4 (the two lines of text, the two circles, and the two arcs). Press Enter to end selection and return to the dialog box. Under the Select Objects button, the dialog box displays 6 objects selected.

7.Click Pick Point in the Base point section of the dialog box.

8.In the drawing, use the Quadrant object snap to pick 1 in Figure 18-4.

9.In the dialog box, select Delete. The Insert Units should be Unitless. Leave the Description blank. The Open in Block Editor check box should not be checked. Click OK to return to your drawing. This action erases the objects that made up the block.

10.To check that the block has been created, choose Make Block from the Draw toolbar. Click the Name drop-down arrow to see your block. Click Cancel.

11.Save your drawing.

Saving blocks as files

You can use the DesignCenter to insert blocks from any drawing. Nevertheless, many users need to organize their blocks in their own files so that they can be easily stored and located. Parts and symbols libraries are made up of many individual drawing files, one for each part or symbol. These libraries are a powerful aid to drawing more efficiently.

To save a block as a file, follow these steps:

1.Type wblock . (WBLOCK stands for write block. Writing to a file is another expression for saving to a file.)

2.In the Write Block dialog box, shown in Figure 18-5, choose the location (drive and folder) for the file.

3.In the Source section, choose how you want to create the drawing file:

Block: Use this option when you’ve already created the block and now want to save it as a drawing file. Choose the block from the drop-down list.

Entire drawing: Use this option to make a copy of your drawing.

Objects: Use this option to start defining the block in the same way that you define a block within a drawing. The Base Point and Objects sections become available.

4.In the File Name and Path text box, type the path and name of the file that you want to create. (You can also click the ellipsis button to navigate to a location and then type a file name in the Browse for Drawing File dialog box. Click Save to return to the Write Block dialog box.) If you’ve already created the block in your drawing, you should generally use the same name as the block to avoid confusion, but you might have special naming conventions for a block library.

5.In the Insert Units drop-down list, choose the units that you want for your block, or choose Unitless for no units.

6.After you’re done, click OK to create the drawing file.

Chapter 18 Working with Blocks and Attributes

527

 

Figure 18-5: Use the Write Block dialog box

 

to save a block as a separate drawing file.

Tip

When you save a drawing that you plan to insert as a block, use the BASE command to create

 

the insertion point. By default, the base point is 0,0,0. By setting the base point to another

 

point in the drawing, such as an object snap on one of the objects, you can control how that

 

drawing is inserted.

Replacing an existing file

If you make a mistake when selecting objects to write to a file with WBLOCK, or you want to change the objects in the file, then you can replace the file. Start WBLOCK and type the name of the block file that you want to change. Be sure to choose the same file location. When you click OK, a message asks whether you want to replace the existing file. Click Yes.

On the

The drawing that you need for the following exercise on saving a block to a file, ab18-

CD-ROM

b.dwg, is in the Drawings folder on the CD-ROM.

STEPS: Saving a Block to a File

1.Open ab18-b.dwg from the CD-ROM.

2.Save the file as ab18-02.dwg in your AutoCAD Bible folder. This is a large title block, as shown in Figure 18-6. OSNAP should be on. Set a running object snap for endpoint.

3.Type wblock . In the Source section of the Write Block dialog box, choose Entire Drawing. Set the File Name and Path box to AutoCAD Bible\tb-f by typing the path and the file name. (Alternatively, click the Ellipsis [. . .] button and navigate to your AutoCAD Bible folder. In the File Name text box, type tb-f. Click Save.) Click OK.

4.Press Enter to repeat the WBLOCK command.

5.In the Source section of the dialog box, choose Objects. In the Objects section, click Select Objects.

Соседние файлы в папке Книги_AutoCad_2