Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

AutoCAD & AutoCAD LT All-In-One Desk Reference For Dummies (2006)

.pdf
Скачиваний:
90
Добавлен:
17.08.2013
Размер:
17.7 Mб
Скачать

352 Creating Blocks

2.Use any of the four methods just listed to initiate the BLOCK command.

The Block Definition dialog box appears (refer to Figure 1-1).

3.In the Name combo box, enter a meaningful name.

The name entered must be unique from others that already exist in the drawing, or you end up redefining the existing block. The name entered must be 255 characters or less.

4.Under the Base Point area, either click the Pick Point button and select a point in the drawing, or enter the coordinate value for the base point in the X, Y, and Z text boxes.

The point that you specify will be used as the base point of the block or its insertion point. Usually this point is on the geometry that is being selected to make up the block.

5.If you clicked the Pick Point button under the Base Point area, you are returned to the drawing window. Specify a point in the drawing to use as the base point for the block.

After you select the base point for the block in the drawing window, you return to the Block Definition dialog box.

6.Under the Objects area, click the Select Objects button.

You are returned to the drawing window where you can select the objects that you want to add to the block.

7.In the drawing window, select the objects you want to add to the block. Press Enter to complete selecting objects and return to the Block Definition dialog box.

The objects you select can be text, lines, circles, and even other blocks. Any object you can select can be added to the block. You can use the QuickSelect button to the right of the Select Objects button to filter objects by specific property values. Quick Select was covered under Chapter 5 of Book VI.

8.In the Block Definition dialog box under the Objects area, click one of the selected object modes.

The different object modes affect what happens to the selected objects after the block is created.

Retain. The selected objects are left as in the drawing.

Convert to block. The selected objects are removed from the drawing, but the new block is inserted at the same location of the original objects.

Delete. The selected objects are removed from the drawing.

Creating Blocks 353

9.Uncheck the Open in Block Editor option at the bottom of the dialog box for now; we cover that option in a little bit.

AutoCAD 2006 introduced a block editor environment for editing blocks and adding dynamic properties. If the Open in Block Editor is checked, the block is opened in the block editor when the Block Definition dialog box is closed.

10.Click OK.

The Block Definition dialog box closes. Results vary based on the selected object mode.

Creating geometry on layer 0 (zero) is usually a “No-No” in AutoCAD, but when geometry is added to a block that is on layer 0, it takes on the properties of the layer that the block is inserted on. This is a great way to check and see if a block happens to be on the correct layer.

Exploring some advanced options

The preceding section covers the basic options in the Block Definition dialog box that you need to create a block. In this section, we cover the other options, as some of them can be used to enforce CAD standards. The following list describes some of the more advanced options and fields contained in the Block Definition dialog box:

Block unit. Specifies the units in which the block is being created. This setting affects how the block is inserted into the drawing. If the block is created in the units of Inches and inserted into a drawing that is specified as Millimeters, AutoCAD scales the block accordingly. If Block unit is set to Unitless, scaling of the block is controlled by the Insertion Scale options in the Options dialog box under the User Preferences tab.

Scale uniformly. When this option is checked, the block can only be scaled equally along all axes.

Allow exploding. When this option is checked, the block can be exploded by using the EXPLODE command. For more information on the EXPLODE command, see Chapter 2 of Book II.

Description. The description is used in different interfaces within AutoCAD that can display the block; some of these interfaces are DesignCenter and tool palettes.

Hyperlink. Allows you to specify a hyperlink for the entire block. The hyperlink could be to a view in the drawing or a layout, or an external location such as a file, or to a website via a URL.

Open in block editor. When this option is checked, the block opens in the Block Editor for further editing after the Block Definition dialog box closes.

Book VI

Chapter 1

with Playing

Blocks

354 Inserting Blocks

Inserting Blocks

AutoCAD stores blocks in what is called the block definition table. The block definition table is used to hold information and settings about the block. In order to get the block to be displayed in the drawing, you need to insert a reference to the block definition from the table. An inserted block in the drawing is known as a block reference because it refers back to its definition in the table. To insert a block into the current drawing file, you use the INSERT command, which opens the Insert dialog box (see Figure 1-2). The INSERT command can insert a block from within the current drawing or an entire drawing file as a block. It just depends on where the information you want to insert into the drawing is located.

Figure 1-2:

The Insert dialog box is used to create a reference to a block definition.

To start the INSERT command and display the Insert dialog box, follow one of the following methods:

Insert menu. Choose Insert Block.

Insert toolbar. Click the Insert Block tool on the Insert toolbar.

Draw toolbar. Click the Insert Block tool from the Insert flyout on the Draw toolbar.

Keyboard input. Type INSERT and press Enter.

Command alias. Type I and press Enter.

The following procedure starts the INSERT command and explains how to insert a block into a drawing.

1.Use any of the previously listed methods to initiate the INSERT command.

The Insert dialog box appears (refer to Figure 1-2).

Inserting Blocks 355

2.In the Insert dialog box, either click the down arrow on the Name drop-down list and select the block that is defined in the drawing to insert, or click the Browse button to insert a drawing as a block.

The selected name is displayed in the text box of the Name drop-down list. If you clicked the Browse button, the Select Drawing File dialog box appears. If the block has a preview saved with it, the preview appears to the right of the Browse button.

3.If you click the Browse button, in the Select Drawing File dialog box, browse and select the drawing file that you want to insert as a block. Click Open.

The name of the selected drawing file is displayed in the text box of the Name drop-down list and the path to the drawing is displayed just below the drop-down list.

4.In the Insert dialog box under the Insertion Point area, either check or uncheck the Specify On-Screen option. If unchecked, enter the coordinate value for the insertion point of the block in the X, Y, and Z text boxes.

If Specify On-Screen is checked, you will be prompted for the insertion point of the block during the block insertion process after the Insert dialog box is closed.

5.Under the Scale area, either check or uncheck the Specify On-Screen option. If unchecked, enter the scale for the x, y, and z axes in the text boxes. If Uniform Scale is checked, you can enter a scale only in the X axis text box and the value is automatically assigned to the two other axes.

If Specify On-Screen is checked, you will be prompted for the scale of the block during the block insertion process. If the block was created with the Scale Uniformly option checked, the Uniform Scale option is disabled and checked (forcing you to use only uniform scale).

6.Under the Rotation area, either check or uncheck the Specify On-Screen option. If unchecked, enter the rotation angle in the Angle text box.

If Specify On-Screen is checked, you are prompted for the rotation angle of the block during the block insertion process.

7.Under the Block Unit area, all you have to do is verify the current insertion units and scale that you want applied to the block.

The Unit value is based on the current setting of the system variable INSUNITS. This variable specifies the drawing’s current units for inserted blocks. The Factor value is the result of the unit used when the block was created and the current value of INSUNITS. To change the current

Book VI

Chapter 1

with Playing

Blocks

356 Managing Blocks

INSUNITS value, close the Insert dialog box and type INSUNITS at the command line or the dynamic input tooltip. Then enter the corresponding integer for the insertion units you want. For more information, look up the topic “INSUNITS” in the AutoCAD online Help.

8.At the bottom of the Insert dialog box, check or uncheck if you want the block to be exploded after it is inserted into the drawing.

If the Allow Exploding option was unchecked in the Block Definition dialog box when the block was created, the Explode option is disabled.

9.Click OK.

The Insert dialog box closes, and you are returned to the drawing window. The INSERT command may still be running based on whether you checked any of the Specify On-Screen options for the insertion point, scale, or rotation. Specify the prompts as required. Here are the three possible prompts:

Specify insertion point or [Basepoint/Scale/Rotate]:

Specify scale factor <1>:

Specify rotation angle <0>:

You can create custom toolbars or pull-down menus to help insert blocks. If you do create your own custom toolbars and menus, you need to use

the –INSERT command instead of the INSERT command for the menu macro. You must run the –INSERT command from the command line or dynamic input tooltip.

Managing Blocks

Blocks are a powerful feature of AutoCAD and no doubt you will be using them as often as you can. AutoCAD offers several tools and commands for managing blocks. Some of the ways to manage blocks in a drawing are as follows:

Rename a block definition

Redefine a block definition

Purge a block definition

Export a block to its own drawing file

Renaming a block definition

You can rename blocks by using the RENAME command. Follow these steps to rename a block:

1.At the command line or the dynamic input tooltip, type RENAME and press Enter.

Managing Blocks 357

2.In the Rename dialog box, select Blocks from the Named Objects list.

3.After selecting the Blocks named object, select the block that you want to rename from the Items list.

The name of the selected block from the Items list is displayed in the Old Name text box.

4.Enter the new name in the text box directly below the Old Name text box and click Rename To.

5.Rename additional blocks if necessary, and then click OK to exit the Rename dialog box.

Redefining a block definition

You can redefine (or edit) a block definition. In releases prior to AutoCAD 2006 and AutoCAD LT 2007, you insert a block and then explode it. After exploding it, you can make the necessary changes to the geometry and then reblock it using the BLOCK command once again. Or you might use the REFEDIT command.

Redefining a block in AutoCAD 2006 is so much simpler with the introduction of the Block Editor. The Block Editor allows you to edit a block in its own drawing window. You use the command BEDIT to start the Block Editor. Follow these steps to edit a block definition with the Block Editor:

1.In the drawing window, select the block that you want to redefine.

2.Right-click and select Block Editor from the shortcut menu.

3.If a message box is displayed about seeing a demonstration in the New Features Workshop, click No.

The block definition is opened in the Block Editor.

4.In the Block Editor, make your changes to the existing geometry or add geometry.

5.Click Close Block Editor to exit the Block Editor.

6.When prompted to save the changes, click Yes.

You are returned to the drawing window, and the references to the block that was redefined are updated.

Purging a block definition from a drawing

You can completely remove blocks from a drawing by using the PURGE command and Purge dialog box. Follow these steps to purge a block definition:

1.Before you can purge the block, you must remove all inserted references of the block.

Book VI

Chapter 1

with Playing

Blocks

358 Managing Blocks

2.At the command line or the dynamic input tooltip, type PURGE and press Enter.

3.In the Purge dialog box, double-click the All Items node if it is not already expanded, and then expand the Blocks node.

The block definitions that can be purged appear.

4.Select the block and click Purge.

By default the Confirm Purge dialog box is displayed.

5.On the Confirm Purge dialog box, click Yes.

The block definition is removed from below the Blocks node and from the drawing.

6.Click Close to exit the Purge dialog box.

Exporting a block definition

Blocks that are created using the BLOCK command are defined in the current drawing only, but many times you will want to be able to access the block from other drawings. The Write Block dialog box, shown in Figure 1-3, is used to export a block out of the current drawing and make a new drawing file based on a selected block. The Write Block dialog box is displayed with the WBLOCK command.

Figure 1-3:

The Write Block dialog box is used to export a block definition

Follow these steps to export a block definition to a new drawing file:

1.At the command line or the dynamic input tooltip, type WBLOCK and press Enter.

Enhancing Blocks with Attributes 359

2.Under the Source area of the Write Block dialog box, select Block.

All the controls under the Source area except for the drop-down list become disabled.

3.From the drop-down list, select the block you want to export.

By default the Confirm Purge dialog box appears.

4.Specify a filename and path in the text box under the Destination area, or click the ellipsis button next to the File Name and Path text box to specify a path and name using a dialog box.

If the ellipsis button is clicked, the Browse for Drawing File dialog box appears. Browse to the location where you want to create the new drawing file and enter a name. Click Save once you have specified the new folder location and filename, and return to the Write Block dialog box.

5.In the Write Block dialog box, specify the Insert units for the new drawing by selecting one of the options from the drop-down list.

AutoCAD applies the insertion units to the drawing and uses them when the drawing is inserted into another drawing.

6.Click OK to export the block as a new drawing and to close the Write Block dialog box.

You can create a new drawing instead of using the WBLOCK command. To define the insertion point that should be used when inserting the drawing into another drawing, use the BASE command or the INSBASE system variable. Either the BASE command or INSBASE system variable allows you to redefine the insertion point that is used for inserting a drawing as a block.

Enhancing Blocks with Attributes

Blocks can store custom information, and that information can later be extracted into an external file or a table object (AutoCAD only). To store custom information on a block, you use an attribute object. You can use attributes to hold a part number or description or even project information in a block. You will often find that title blocks contain attributes in them, which allows the user to edit all the attributes at one time instead of individually like you would have to with text or multiline text. Attributes may appear like standard text objects, but they are much more than that. You can change the text value of attributes when they are part of a block.

Adding an attribute to a block definition

Attributes are added to a block the same way as lines or arcs. First they are added to the drawing and then added to the block. When an attribute

is added to a drawing, it is first known as an attribute definition. The attribute definition is stored in the block definition and is used to describe what the

Book VI

Chapter 1

with Playing

Blocks

360 Enhancing Blocks with Attributes

actual attribute of the block reference should be like. To create an attribute definition, you choose the ATTDEF command to display the Attribute Definition dialog box (see Figure 1-4).

Figure 1-4:

Creating an attribute definition.

To start the ATTDEF command and display the Attribute Definition dialog box, follow one of the following methods:

Draw menu. Choose Draw Block Define Attributes.

Keyboard input. Type ATTDEF and press Enter.

Command alias. Type ATT and press Enter.

The following procedure starts the ATTDEF command and explains how to create an attribute definition and then add it to a block.

1.Add the geometry to your drawing that you want to combine into a block.

2.Use any of the methods previously listed to initiate the ATTDEF command.

The Attribute Definition dialog box appears (refer to Figure 1-4).

3.In the Attribute Definition dialog box, select the options under the Mode area that you want to use for the attribute definition.

Attributes can have four different modes:

Invisible. When this option is checked, the attribute is invisible. By default, the attribute is invisible, but the system variable ATTMODE set to a value of 2 displays all invisible attributes in the drawing.

Enhancing Blocks with Attributes 361

Constant. When this option is checked, the attribute has a fixed value and can’t be changed.

Verify. When this option is checked, you are prompted to verify that the value entered is correct for the block being inserted into a drawing.

Preset. When this option is checked, the default value is automatically assigned to the block when it is inserted into a drawing.

4.Under the Attributes area, specify the attribute’s tag, prompt, and value.

The tag is the value you see on-screen before the attribute is added to a block. The prompt is what the user sees in the Edit Attributes or the

Enhanced Attribute Editor (AutoCAD only). The value defines the default value that the attribute has. If you are using AutoCAD (and not AutoCAD LT), you can specify a field to define the attribute’s value.

5.Under the Insertion Point area, either check or uncheck the Specify On-Screen option. If it’s unchecked, enter the coordinate value for the insertion point of the block in the X, Y, and Z text boxes.

If Specify On-Screen is checked, you will be prompted for the insertion point of the block after you click OK to close the Attribute Definition dialog box.

6.Under the Text Options area, specify the attribute’s justification, text style, height, and rotation.

The Justification of the attribute controls its insertion point. The Text Style is used to control the font and other text characteristics. Height is used to specify the height of the attribute, and Rotation controls its rotation angle after the attribute is created. Both the height and rotation properties have buttons that can be used to specify a distance or angle using points in the drawing.

7.Initially, the Align below Previous Attribute Definition check box is disabled. Check the option if you have inserted an attribute in your drawing and want the next one placed below the previously created one.

When this option is checked, the attribute is positioned below the previously created attribute.

8.Check the Lock Position in Block option if you want to disable grip editing and other ways of editing the attribute’s position.

This option is usually used in conjunction with adding dynamic parameters to the block. Dynamic blocks are discussed in the next chapter.

9.Click OK.

The Attribute Definition dialog box closes, and you are returned to the drawing window. The ATTDEF command might still be running depending

Book VI

Chapter 1

with Playing

Blocks