Sie sind auf Seite 1von 28

AutoCAD Tutorial: Create a dynamic block of a door

Dynamic blocks are an amazing feature, but they can be complicated. This tutorial will teach you many techniques
that you can use in your own blocks. The door will do the following:

• Stretch to 3 sizes
• Flip left/right
• Flip in/out

Follow these steps:

1. In a new drawing using architectural units, create a DOOR layer and make it the current layer.
2. Draw a rectangle 1-1/2" x 30'. This is the door.
3. Star the ARC command and use the Center option. Specify the lower-left corner of the door as the center.
For the first point, move the cursor to the right at 0°, and type 30 on the command line/dynamic input
tooltip. Specify the upper-right corner of the door to draw the arc and complete the swing.

4. Select both objects, and start the BLOCK command. Call the block Door. Set its base point at the lower-left
corner of the door. Check the Open in Block Editor check box. Click OK. The door opens in the Block Editor
with its base point at the 0,0 point of the axes.

5. From the Parameters tab of the Block Authoring palettes, choose Linear Parameter. At the prompt, pick the
lower-left corner of the door and then the start point of the arc on the right. Then pick a point below the
door for the label.
Note: The exclamation point indicates that the process is incomplete or incorrect. You almost always see the
exclamation point when you place a parameter, because most parameters need an action.

6. Select the parameter, right-click it, and choose Grip Display > 1. This removes the left grip, which is
important because you'll be stretching from the right grip only. If you don’t do this step, the exclamation
point won’t go away when you add the action.
7. With the parameter still selected, open the Properties palette. Change the Distance Label item's value to
Door width.
8. From the Actions tab, choose Stretch Action. At the prompt, select the linear parameter.
9. At the Specify parameter point to associate with action or enter [sTart point/Second point] <Start>:
prompt, click the right grip (the turquoise triangle).
10. At the Specify first corner of stretch frame or [CPolygon]: prompt, pick a point above and to the right of
the door. At the Specify opposite corner: prompt, pick a point to the left of the door and down, as you see
here.

11. At the Select objects: prompt, pick the door (the rectangle), but nothing else. End selection.
12. At the Specify action location or [Multiplier/Offset]: prompt, right-click and choose the Offset option. This
option lets you change the angle of the stretch action. At the Enter angle offset <0.00>: prompt, enter
90.
13. The prompt repeats. Pick a point to the right of the grip, as you see here. The stretch action is complete
and the exclamation point disappears.

14. Before going any further, click the Save Block Definition button on the Block Editor's toolbar and click
the Close Block Editor button. It's a good practice to test your dynamic block at each stage.
15. Save your drawing, too. Select the door, click the Stretch grip on the right and drag to the right. The door
should stretch in the 90° direction, as you see here. Of course, the arc doesn't do anything, but we'll fix
that later.

16. In order to constrain the width of the door to common widths, select the door and open the Block Editor
again.
17. Select the linear parameter. In the Properties palette, scroll down to the Value Set section.
18. Click the Dist Type item and choose List from the drop-down list. Click the Dist Value List item and click
the Ellipsis button. Enter 32 in the Distance to Add box and press Enter. Then enter 36 and press Enter.
Then click OK. You now see thin, vertical bars to the right of the door to indicate the allowable door
widths.
19. Save the block again and close the Block Editor. You'll probably see this dialog box. Sometimes, saving
changes to a block that's already in your drawing can cause problems, but usually it's all right. So click
Yes.

20. Try stretching the door this time. You’ll see those vertical bars again and you’ll be able to stretch only to
those bars.
21. Now it’s time to get that arc to follow the door. You might think that you could stretch the arc, too, but
stretched arcs become distorted. Instead, you want to scale the arc. Because you want the arc to stretch
by the same amount that you stretch the door, you use the same parameter and add another action to it,
this time a Scale action. So, open the Door block in the Block Editor again.
22. On the Actions tab, choose Scale Action. At the Select parameter: prompt, select the linear parameter. At
the Select objects: prompt, select the arc and end selection. At the Specify action location or [Base type]:
prompt, place the action label near the arc.
23. Save and close. Check out the door now. As you stretch the door, the arc scales accordingly. Make sure
that there are no gaps at any width. If there are, you need to correct something.
24. It would be great to create a door that can flip in all directions because this could replace four separate
blocks or remove the necessity to insert a door block at negative values. To do this, open the door in the
Block Editor again.
25. From the Parameters tab, choose Flip Parameter. At the Specify base point of reflection line or
[Name/Label/Description/Palette]: prompt, Shift+right-click and choose Mid Between Two Points. Then
specify the endpoint at the basepoint of the block and the endpoint at the start point of the arc. At the
Specify endpoint of reflection line: prompt, move up 90° and pick. (The length of the reflection line is not
important.) At the Specify label location: prompt, pick a location inside the arc.
26. From the Actions tab, choose Flip Action. At the Select parameter: prompt, choose the Flip parameter. At
the Select objects: prompt, select the door and its arc. Place the label next to the Flip parameter. Save the
block and exit the Block Editor.
27. Select the block. Click the flip grip and the door flips. Flip it back again. Now try stretching the door to its
maximum width and flip again. There are two problems:
o The stretch grip stays on the right when you flip the door, so now you can’t stretch the door.
o Did you notice that the flip grip stays where it was? It’s no longer in the middle of the door, which
means that it won’t flip properly. If you draw two walls with a 3’ gap and flip the door, you’ll see
this clearly.

Note: You can see why you need to test dynamic blocks thoroughly!
28. To make the stretch grip flip, you need to include it in the selection set of the flip action. In fact, you need
to include the linear parameter, the stretch action, and the arc’s scale action so that everything works no
matter which way the door is flipped. So, open the door in the Block Editor again.
29. Select the flip action (not the flip parameter). Right-click it and choose Action Selection Set > Modify
Selection Set. At the Select object to add to action set or [Remove]: prompt, select the linear parameter
(labeled Door width), the stretch action, and the scale action and press Enter to end selection.
30. Save the block and exit the Block Editor. Start by stretching the door back to its minimum of 30". Flip the
door a couple of times and you’ll see that the stretch grip flips back and forth at all widths. The arc works
properly, too.
31. To fix the problem with the flip grip not staying at the midpoint, you need to move it when you stretch the
door. In fact, you need to move it half the distance that you stretch. This will keep the flip grip centered.
Open the door in the Block Editor again.
32. From the Actions tab, choose Move Action. At the Select parameter: prompt, select the linear parameter,
because you want the flip parameter to move in concert (but half the distance of) that parameter. At the
Specify parameter point to associate with action or enter [sTart point/Second point] <Start>: prompt,
pick the right grip on the linear parameter. At the Select objects: prompt, select the flip parameter (not
the action). End selection, and then right-click and choose the Multiplier option. At the Enter distance
multiplier <1.0000>: prompt, enter .5. Finally, place the move label near the flip parameter. Save, and
exit the Block Editor.
33. Test the door at thre 3 widths. Now, when you stretch the door, after you click, the flip grip jumps to the
new midpoint of the door.
34. Actually, there’s one more problem! You don’t see it unless you do the following. Start with the door
opening to the right (flipped from its original direction) and stretch it to its maximum width, 3’. Flip it.
Then stretch it to its narrowest width. Do you see how the block’s insertion point doesn’t move with the
block? This makes moving the block difficult. So open the door for editing again.
35. From the Parameters tab, choose Base Point Parameter. At the prompt, specify the bottom-left corner of
the door, which is 0,0 in the Block Editor.
36. Now, select the flip action, right-click, and choose Action Selection Set > Modify Selection Set. At the
Select object to add to action set or [Remove]: prompt, select the new base point parameter and press
Enter to end selection. Save and close the Block Editor.
37. Test the block again as you did before (it may have moved -- if so, move it back). You’ll see that the
block’s base point always stays on the block.
38. There’s just one more procedure—to add a flip action going the other way, so that the door can open
inward or outward. So open the door for editing again.
39. Choose Flip Parameter and place the reflection at the lower-left corner of the door -- the basepoint. Place
the label to the left of the door.
40. On the Actions tab, choose Flip Action. At the Select parameter: prompt, choose the flip parameter. At the
Select objects: prompt, select everything. (That’s what you learned you needed to do in the previous
steps.) You should see 13 found. End selection. At the Specify action location: prompt, place the label
beneath the flip parameter label.
41. Save and exit and test the door.
42. You probably thought you were done, but there’s one more step. As you did before, stretch the door to its
maximum width. Flip the door to the left and then stretch it to its narrowest. You’ll see that the new flip
grip doesn’t follow. That’s because it isn’t included in the first flip action you created. (It couldn’t be,
because the new flip action didn’t exist then.) In fact, you want the in/out flip parameter to flip with the
left/right flip action.
43. Re-edit the block. Select the first flip action, right-click and choose Action SelectionSet > Modify Selection
Set. At the Select object to add to action set or [Remove]: prompt, select the new flip parameter. Save,
exit, and test again.

As you can see, there is often an iterative process, requiring you to go back and include new objects in actions that
you created earlier. Remember to thoroughly test your dynamic blocks!

Dynamic Blocks 1
30 March 2007, Friday 8:27 Print This Post

Author Erhan Toker

Profession Architect M.Sc.

Autodesk Authorized Consultant

Software Specialist

e-mail

AutoCAD 2006 and higher versions

In AutoCAD 2006, a brand new feature named as DYNAMIC BLOCKS were introduced. This new

feature is a very important feature that is added to AutoCAD just like internal render. Now, we can

do nearly everything that we were willing to do with the blocks just by using this feature. I will

immediately give and example to explain what I am trying to tell.


Example.1 Editing a computer table which is prepared by using dynamic block

properties.

For example, we want a computer table to remain at standard lengths of 90, 100, 110, 120 and

130 cm, but we want its depth to be constant at 80cm. In the past, in order to deal with such a

problem, you would have to create 5 different numbers of blocks. But now, only one block with

dynamic attributes is enough.


Fig. 2 Dynamic blocks editing screen in AutoCAD.

As you can see in Fig. 2, dynamic blocks can be edited in a drawing environment that has a yellow

background. We have two different options for editing dynamic blocks: (1) You will edit a dynamic

block or an existing block or (2) you will create a new dynamic block in an empty editing screen.

Indeed, a new drawings screen is not different than a normal drawing screen. However, there is a

toolbar at the top and a new tool palette on the right side in this screen which is called block

editor (You can see it more detailed in my article about AutoCAD tool palettes). They include tools

that are used to edit the dynamic blocks.

** DYNAMIC BLOCKS

** Parameters & Actions

Different than the standard blocks, dynamic blocks have the properties of parameters and actions.

More than one parameter or action can be assigned to any block. In general, parameters define

the dimensions and location of the block. On the other side, actions define how the parameter to

which it is assigned will operate and do the work that it is supposed to do. As an exception,

ALIGNMENT parameters do not necessarily be assigned with an action. Dynamic blocks that have

this parameter automatically align themselves to any drawing entity in a parallel way or
perpendicularly. For example, if a wash basin block is made so that it can be aligned to a wall

entity, then this would be a very practical job.

The simplest example is that you can move an entity inside a block free from the block itself. In

order to do this, you can use a POINT parameter and a MOVE action that is assigned to this point.

When you insert a block that is prepared having these properties, then the POINT parameter that

you have defined will be seen just like ENDPOINT, MIDPOINT etc. So that, when you select and

drag this point, then the entity that you attached to this point will move freely from the block.

Now, let me finish my article with an example:

Fig.3

To enter dynamic block editor, select Tools/Block Editor, write BEDIT into the command line or

select the Block Editor as shown in Fig. 3. Then you will see that Edit Block Definition window will

open up (Fig. 4).

Fig.4
We would like to create a new block, so let’s enter HOLE name and press OK. Then we will se the

editing screen as shown in Fig. 2. What we want to do is to draw a circle with 10 radius inside a

square with 100×100 dimensions. First of all, let’s make the drawing as shown in Fig. 5.

Fig.5

Our aim is to give to the hole the ability to move freely from the block. In order to do this, we

need a POINT parameter. Let’s select Parameters tab from the tool palette from the left side and

use POINT PARAMETER from there. Insert the point just at the center of circle. Actually, this is

not necessary but, this will look more logical while using it. After inserting the point, change

POSITION LABEL property from PROPERTIES tool palette as center. ‘!’ that you see near the

point means that this parameter has not been assigned to any action yet.

Fig.6

Now, let’s select MOVE action from ACTIONS tab. When you select the action, AutoCAD will

prompt you through the command line to select a parameter. Select the parameter named center.

After that, it will prompt you to select some entities to which MOVE action will apply. Select only

the circle and place the action symbol just over the parameter symbol.
Fig.7

Now, select MOVE action from ACTIONS tab. If you want, you can also change the action name

as DRAG from properties menu. Press Close Block Editor symbol from the toolbar at the top and

save changes. You will notice that AutoCAD returns back to the original drawing screen. Now, let’s

insert our new block and try its dynamic properties. After inserting the block with the normal

INSERT command, select it. Other than the usual insertion point you will see another point at the

center of circle. This point is the parameter that we added inside the dynamic block. By holding

this point and dragging, you will see that you can move the circle freely from the block (Fig. 7)

That’s all for this week. Bye.

Dynamic Blocks 2
2 April 2007, Monday 8:54 Print This Post

Author Erhan Toker

Profession Architect M.Sc.

Autodesk Authorized Consultant

Software Specialist

e-mail

AutoCAD 2006 and higher versions

Hello Daily AutoCAD readers,


Here we are together with the second part of dynamical blocks articles. This week, we will start by

giving an example to the LINEAR parameter. LINEAR parameters are generally associated with

STRETCH action. Table example that we have defined last week is a good example for this. Now,

let’s enter block editor command again and start editing a block named as TABLE80.

Fig. 1

Draw a rectangle with dimensions of 100×80 and add a LINEAR parameter on it. One or two

STRETCH action can be added to linear parameters. If we will add two STRETCH actions, then

we need two GRIP points, and if we will add one STRETCH action than we need one GRIP point.

LINEAR parameter that you can see in Fig. 1 has two numbers of GRIP points. GRIP points are

shown with a blue triangle on the drawing. You can change number of GRIP points from

properties tool palette (Fig. 2). If you select only one GRIP point, then you must set the side

where GRIP point will be on, by using ‘Base Location’ property. In our example, there will be

only one GRIP point. If you mark the LINEAR parameter from left to right, then you must set

‘Base Location = Start Point’.


Fig. 2

As we didn’t assign any action to the parameter, a ‘!’ sign is seen on it. Let’s select STRETCH

parameter from ‘Actions’ part. We will be prompted to enter a parameter for the action.

Fig. 3

As soon as we select the parameter, then a message as shown in Fig. 3 will be shown. This

message asks us about which parameter will be associated with the STRETCH action.

Fig. 4
As you move the mouse cursor on any side, then cursor will change into the shape shown in Fig.

4. In our example, grip on the right side must be selected. Later, you will be prompted to select a

stretching area and entities that will be stretched similar to how STRETCH command works.

Fig. 5

Do your selection as shown in Fig. 5 and do the STRETCH action. Save your block by using

‘Close Block Editor’ button, then your block will be ready as you return back to model screen.

Now, insert your new block into the model by using ‘INSERT’ command and try to use it. First

thing that you will immediately notice is that length of the table can change according to all of the

lengths. However, we want our linear parameter to change in between values of 90, 100, 110,

120 and 130. It is quite simple to do this. We can easily do this by changing the properties our

linear parameter. Then, let’s immediately return back to block editor and have a look at these

properties.

Fig. 6

Let’s select our LINEAR parameter and change ‘Dist Type = List’ and ‘Dist value list =

90;100;110;120;130’ from ‘PROPERTIES’ tool palette as shown in Fig. 6. You can fill in this list
from the windows which opens up when you press the small button shown with ‘…’. Save changes

and return back to model screen by using ‘Close Block Editor’. Now, you block will have gained the

abilities as shown in Fig. 7.

Fig. 7

Dynamic Blocks 3
3 April 2007, Tuesday 7:52 Print This Post

Author Erhan Toker

Profession Architect M.Sc.

Autodesk Authorized Consultant

Software Specialist

e-mail

AutoCAD 2006 and higher versions

Hello Daily AutoCAD readers,

Here we are together again with the last article about dynamic blocks. Actually, subject of

dynamic blocks in so large that it cannot fit into 3 articles only. However, in order to leave space
for other topics and not to bore advanced users, I am going to finish the subject with this week’s

examples.

Example 3.1 : ARRAY Action

ARRAY action can be associated with LINEAR, POLAR, and XY parameters. We have to select

one of these parameters according to the drawing that we are about to do. In this example, we

are going to draw a simple bolt and see how the thread numbers increase depending upon its

length.

Fig. 1

First of all, make the drawing as shown in Fig. 1. Thread spaces must be 1mm. Drawings

example shown in figure is kept as simple as possible to be completed though out this example.

In this example, both STRETCH and ARRAY actions will be assigned to LINEAR parameter. First,

let’s add the LINEAR parameter as shown in Fig. 2.


Fig. 2

Enter properties of LINEAR parameter and change accordingly so that ‘Distance label=Length‘,

‘Number Of Grips=1’. After editing, your parameter should look like as shown in Fig. 2. Next

step is to add STRETCH action. Let’s add this action as described in my previous article.

Fig. 3

Select the area that will be stretched, parameter point and entities as shown in figure. After

adding this action, then it is time to add the ARRAY action. ARRAY action is no different than the

usual ARRAY command that we are familiar with. As your array is LINEAR, then ARRAY action

will be done in one direction only.


Fig. 4

After you assign ARRAY action with your LINEAR parameter, then AutoCAD will ask you about

which entities you will select. Let’s select the single thread that we have drawn. Then, AutoCAD

will ask it classical question ‘Enter the distance between columns (|||): 1’. As we selected out

thread spacing as 1mm, then answer this question with 1. Now, it is time to explain why we have

drawn only 1 thread at the beginning.

Fig. 5

ARRAY action assumes that the length of LINEAR parameter to which it is assigned, as length.

This distance is divided equally by the value entered for ‘Distance between columns’ and

places the selected object at these intervals. So, when you insert this dynamic block for the first

time, it will already have 30 numbers of threads. Later on, thread number will increase or

decrease depending up on the length of the parameter (Fig. 5).

Example 3.2 : FLIP Parameter and FLIP action


In this example, I will explain how to solve a general problem that is faced by all of the architects

by using dynamic blocks. For door drawings, if you change the hinge point, then you have to

mirror the sweeping arc and its direction. This is a laborious and time consuming job to do.

However, by the help of dynamic blocks you can easily do this with one touch. First, let’s enter

block editor and draw a door as shown in Fig. 6.

Fig. 6

This is a classical 90×90 door. Now, let’s add a FLIP action. But, first we have to position the

FLIP parameter.

Fig. 7

This parameter is positioned by selecting two points just like a MIRROR LINE. After positioning

the parameters, then let’s change its properties as ‘Flip label=Left_Right’, ‘Base state

label=Left‘ and ‘Flipped state label=Right’.


Fig. 8

Finally, we have to associate FLIP action with the FLIP parameter. To do this, select FLIP action.

Then, first select the parameter and then the entities that will be mirrored, which are door wing

and the sweep arc. As you exit the block editor and insert the block into the drawing, then you

will see that direction of the block changes with a single action.

Fig. 9

In Fig. 9, you can see how the block changes its direction. So, this is the end of series of articles

about dynamic blocks. After this fundamental information about dynamic blocks, now you are

ready to create your own dynamic blocks easily. For more advanced information, you can refer to

the following resources.

Dynamic Blocks and LOOKUP parameter


5 April 2007, Thursday 8:27 Print This Post
Author Erhan Toker

Profession Architect M.Sc.

Autodesk Authorized Consultant

Software Specialist

e-mail

AutoCAD 2006 and higher versions

We are ending our article series about dynamic blocks by introducing the LOOKUP parameter.

If you examine all of the articles about dynamic blocks, there should not be any open points about

dynamic blocks. Now, let’s go back to our article. LOOKUP parameter is used for creating a

preliminary setting list. You can assign one or more normal parameter to each of the items in this

list. By this way, you can run more than one action at the same time or in pre-defined way by

selecting one item in the list. In our example, we will examine how to rotate a chair block by 4

main angles (Fig. 1).

Fig. 1

There is one ROTATE parameter/action couple and one LOOKUP parameter/action couple

inserted inside the block. As usual, we are entering block editor and creating a simple chair (Fig.

2).
Fig. 2

Try to keep insertion point as 0,0 point and the angle as shown in figure. After this, let’s insert a

ROTATE parameter (Fig. 3).


Fig. 3

Select rotation center of the parameter, or what we call BASE POINT, as the center of the block.

From the properties of ROTATE parameter, make ‘Ang type = List’ and ‘Ang value list =

0,90,180,270’. By this way, our chair will be able to be rotated by 4 main angle directions. As we

can control the ROTATE parameter by LOOKUP list, we have to prevent it to look inside the

block. At this stage, we must change properties as ‘Show Properties = NO’ and ‘Number of

Grips = 0’ to do this. Finally, let’s associate our ROTATE parameter with a ROTATE action. When

we finish, our block should look like as shown in Fig. 3. All of the settings and buttons are shown

all together in Fig. 3. After ROTATE parameter, we will insert LOOKUP parameter and action (Fig.

4).
Fig. 4

After inserting the parameter, we have to associate it with a LOOKUP action. As soon as

LOOKUP parameter is selected for association, a ‘Lookup Table’ window will open up (Fig. 5).

Fig. 5
By using ‘Add Properties…’ button, you will reach a list of parameters that has already been

defined for this block from block editor. Select ROTATE parameter from this list (with Angle

default name). When you return back to main window, you will see that it is divided into two.

There is ROTATE parameter on the left side, and there is LOOKUP parameter on the right side.

Select pre-defined angles respectively from the left side and create 4 rows for them. After this,

you have to define what will be written in the selection list that corresponds to these angles on

the right side. Empty cells are not accepted. Here, I gave same names with the angles. Close this

window and then close the block editor (save changes). Now, our block is ready to be used (Fig.

1).

Automatic insertion angle in Dynamic Blocks


4 April 2008, Friday 7:16 Print This Post

Author Erhan Toker

Profession Architect M.Sc.

Autodesk Authorized Consultant

Software Specialist

e-mail

AutoCAD 2006 and higher versions

In this article, I will explain how to make a smart block which determines the angle of the line

over which the block is placed and aligns itself to that angle.
Fig. 1

Of course, I am assuming that whoever tries to get use of this article should have enough

knowledge about dynamic blocks or have read my articles dynamic blocks I, II and III. All of

their links are given at the beginning of article. In order to start our block, we first enter dynamic

block editor. Here, I drew a simple washbasin. You can start with a simple rectangle. Insertion

point of our block will be as shown in Fig. 2.

Fig. 2

Then, let’s assign an ALIGNMENT parameter to the marked point (Fig. 3).

Fig. 3
While assigning the parameter, mark the ALIGNMENT TYPE as TANGENT. I would like to remind

you that if we select PERPENDICULAR here, then our block will be perpendicular to the entity

over which it is placed.

Specify alignment direction or alignment type [Type] : T


Enter alignment type [Perpendicular/Tangent] : T
Specify alignment direction or alignment type [Type] : 0

Aligning parameter does not require any operation. As soon as you assign the parameter, it will

look like as shown in Fig. 4.

Fig. 4

As we have finished our work, now it is time to close the block editor and have a look at how good

we have done. Let’s run the usual INSERT command that we always use and select the insertion

point of the block as the midpoint of a line that is not straight but angular. Then, you will notice

that our block will be immediately inserted as aligned to this line. However, it still needs some

practice to determine which side it will be placed. Alignment will be towards the side where you

approach the line. You can easily understand this by making some practice.

Das könnte Ihnen auch gefallen