Anda di halaman 1dari 6

Excerpt from AutoCAD and AutoCAD LT Bible

By Ellen Finkelstein | ellen@ellenfinkelstein.com


Reprinted with permission from Wiley | All rights reserved.

This excerpt is part of Chapter 18 of AutoCAD and AutoCAD LT


Bible and is an exercise on dynamic blocks. In the book, the
section on dynamic blocks includes:

An explanation of the concepts behind dynamic blocks


How they fit into the workflow of creating a drawing.
A detailed discussion on defining a dynamic block
How to insert parameters and actions.
Special sections on visibility and lookup parameters
A list of all the parameters and actions and how they
work together
A list of all the prompts and options for actions and how
to use them
A discussion of parameter sets
How to save dynamic blocks
How to insert and modify them

You can buy in-print editions of AutoCAD and AutoCAD LT Bible on Amazon.com
here.
Note: In the exercise, italic text is used for instructions, file or folder names, and terms that you see
on the screen. Bold text is used for text that you need to type. The symbol means to press Enter.

Step-by-Step: Creating and Inserting Dynamic Blocks


1.

Open deskset.dwg, which is


included in the ZIP file with this
tutorial. This is a set of office
furniture, as shown in Figure 1.

Figure 1: The office furniture consists


of a few blocks that can be more useful
if they are dynamic.

2.

Save the drawing as


deskset1.dwg (to keep the
original unchanged in case
you want to use it again).

3.

Pass the cursor over any part of the drawing. You can see that it is all one block,
called DeskSet.

4.

On the ribbons Home tab, in the Block panel, choose Edit or type bedit on the
Command line. In the Edit Block Definition dialog box, choose DeskSet and click
OK. The Block Editor opens with the desk set (including a desk, armchair, computer,
monitor, and phone) displayed. Inside the Block Editor, you work with the individual
components of the DeskSet block. The Block Authoring palette also opens.

5.

You want to be able to move the armchair separately from the rest of the block. To
add a point parameter to the chair, click the Parameters tab of the Block Authoring
palette and choose Point.

6.

Follow these prompts:


Specify parameter location or [Name/Label/Chain/Description/Palette]: Right-click and
choose Label.
Enter position property label <Position>: Chair Location
Specify parameter location or [Name/Label/Chain/Description/Palette]: Pick the
endpoint at the middle of the front of the chair.
Specify label location: Pick a location for the Chair Location label.

7.

8.

To add a move action to the point parameter, click the Actions tab and choose
Move. Follow the prompts:
Select parameter: Select the point parameter by clicking on its label.
Specify selection set for action. Select objects: Select all the objects that make up the
chair. (In this instance, it doesnt make any difference whether or not you include the
parameter itself in the selection set.)
Select objects:
To add a linear parameter to the desk, click the Parameters tab and choose Linear.
Follow the prompts:

Specify start point or [Name/Label/Chain/Description/Base/Palette/Value set]:


Rightclick and choose Label.
Enter distance property label <Distance>: Desk length
Specify start point or [Name/Label/Chain/Description/Base/Palette/Value set]:
Rightclick and choose Value set.
Enter distance value set type [None/List/Increment] <None>: Choose Increment
from the drop-down list.
Enter distance increment: 6
Enter minimum distance: 48
Enter maximum distance: 72
Specify start point or [Name/Label/Chain/Description/Base/Palette/Value set]: Choose
the endpoint at the upper-left corner of the desk.
Specify endpoint: Choose the endpoint at the upper-right corner of the desk. Specify
label location: Pick a location above the desk.
9. To simplify matters, we only want the right grip for the linear parameter. This makes
sure that the desk can be stretched only towards the right. Select the linear
parameter. Right-click and choose Grip Display > 1.
10. Click the Actons tab and choose Stretch. Follow the prompts:
Select parameter: Select the linear parameter by clicking its label.

Specify parameter point to associate with action or enter [sTart point/Second point]
<Start>: Right-click and choose Second point.
Specify first corner of stretch frame or [CPolygon]: Click at .
Specify opposite corner: Click at . Be sure to click below the lower-right corner of the
desk.
Specify objects to stretch. Select objects: Click close to but not on top of .
Specify opposite corner: Click close to but not on top of .
Select objects:
11. The block should look like Figure 2.

Figure 2: The DeskSet block after adding a move action to the armchair and a stretch action to the
desk.

12. To allow for various size monitors, click the Parameters tab and choose Linear. Rightclick and choose the Label option. Type Monitor width
13. At the next two prompts, pick points and in Figure 2. Then place the parameter
label above the monitor.
14. You can create a value set in the Properties palette. Select the Monitor width
parameter and open the Properties palette (Ctrl+1). In the Value Set section, choose
List from the Dist type item. Click the Dist Value List item, click the button to the right
to open the Add Distance Value dialog box. The current width is already there. In the
Add text box, type 18-1/2 . The value changes to 1'-6 1/2" and moves below to the
list box. Again in the Add text box, type 20-1/2 . Click OK to close the dialog box.
Close or minimize the Properties palette.
15. Select the linear parameter. Right-click and choose Grip Display > 1.
16. Click the Actions tab on the Block Authoring palette and choose Stretch. At the Select
parameter: prompt, select the linear parameter you just created. At the next prompt,
choose the Second Point option. To specify the stretch frame, pick and then in
Figure 2. To select objects, pick near and then near . Press Enter to end
selection. You may want to turn off Object Snap for this step to ensure that the points
you specify dont snap to another nearby object.

17. We want to create a lookup parameter for the monitor. On the Parameters tab,
choose Lookup and pick a location on the monitor. On the Actions tab, choose
Lookup. Select the lookup parameter The Property Lookup Table dialog box opens.
18. Click Add Properties. In the Add Parameter Properties dialog box, choose the Linear
1 parameter and click OK. Back in the Property Lookup Table dialog box, click the
first row on the Input Properties side, below the Monitor Width heading and choose
the first measurement from the drop-down list. In the same row on the Lookup
Properties side, type 15" monitor. (Note that monitors are measured diagonally, so
the horizontal width of a 15" monitor is not 15".) In the second row on the Input
Properties side, choose the second measurement and enter 17" monitor on the right.
In the third row on the left, choose the last measurement and enter 19" monitor on
the right.
19. Click the Read Only cell and choose Allow Reverse Lookup from the drop-down list.
The Property Lookup Table dialog box should look like Figure 3. Click OK.

Figure 3: The Property Lookup Table dialog box is ready to create a lookup table for the computer
monitor.

20. Because some people may not have a phone, we want to create a visibility parameter
and action for the phone. On the Parameters tab, choose Visibility. Follow the
prompts:
Specify parameter location or [Name/Label/Description/Palette]: Right-click and
choose Label.
Enter visibility property label <Visibility>: Phone/No Phone
Specify parameter location or [Name/Label/Description/Palette]: Pick a location near
the phone.
21. Choose Visibility States from the Block Editor tabs Visibility panel. The Visibility
States dialog box opens. Click the VisibilityState0 item and type Has phone . Click
New. In the Visibility State Name text box of the New Visibility State dialog box, type
No phone . Click OK twice to return to the Block Editor.
22. From the Visibility States drop-down list on the ribbon, make sure that No Phone is
displayed; if not, choose it. Click the Make Invisible button inn the Visibility panel. At
the Select objects: prompt, select all the objects of the phone and press Enter to end

selection. To double-check the visibility states, choose the Has Phone state from the
Visibility panels drop-down list and make sure that the phone appears.
23. Your block should look like Figure 4. Click Save Block on the Block Editor tab. Then
click Close Block Editor. Save your drawing.

Figure 4: The completed dynamic block in the Block Editor.

24. Open a new drawing based on the default template or any template you usually use.
Open the DesignCenter. (You can find it on the View tab in the Palettes panel.) In the
Folder List pane, browse to, and double-click deskset1.dwg. Click Blocks. Drag the
DeskSet block from the right side of the DesignCenter to your drawing.
Note: If you create a block inside a drawing and then make it dynamic, you need to use the
DesignCenter to insert it. If you try to insert the entire drawing, you get only a regular block.
However, if you dont create a block in the source drawing and create the dynamic block in
the Block Editor without ever creating and naming a block, you can use the INSERT
command to insert the entire drawing and use the dynamic features of the block
25. From the Navigation bar, choose Zoom >Extents. Close or minimize the
DesignCenter.
26. Select the DeskSet block. It should look like Figure 5.

Figure 5: When you select a dynamic block, you see grips for its dynamic features.

27. Click the desks stretch grip and stretch the desk one vertical line to the left to make it
6 inches shorter. The computer moves with the desk.
28. Click the armchairs move grip and move the chair to the left so that it is still centered
in front of the computer.
29. Click the monitors lookup grip and choose 19" monitor from the drop-down list. The
monitor gets wider.
30. Click the phones visibility grip and choose No phone from the drop-down list. The
phone disappears.

Discover more great tips to increase your productivity!


This 50+ page e-book will make your drawing and editing go more smoothly
and quickly. Learn from AutoCAD expert Ellen Finkelstein, with the help of
submitted tips from many others around the world. For example:

The 4 ways to import text


Find a list of all named objects in your drawing
Print a list of text styles
Secret MText options
And much more!

Only $9.95!

Anda mungkin juga menyukai