Você está na página 1de 18

www.dailyautocad.

com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.












www.dailyautocad.com
Daily AutoCAD
-book 4
..................................................................................................................................................................................
.
"Dynamic Blocks"
By Erhan Toker


www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
0ynamIc Iocks 1

Erhan Toker
Architect
Autodesk Authorized Consultant
Software Specialist


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.
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.

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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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 lets 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 100100 dimensions. First of all, lets
make the drawing as shown in Fig. 5.

Fig.5
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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. Lets 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, lets 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
the toolbar at the top and save changes. You will notice that AutoCAD returns back
to the original drawing screen. Now, lets 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)
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
0ynamIc Iocks 2

Erhan Toker
Architect
Autodesk Authorized Consultant
Software Specialist

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, lets enter block editor command again
and start editing a block named as TABLE80.

Fig. 1
Draw a rectangle with dimensions of 10080 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
As we didnt assign any action to the parameter, a `! sign is seen on it. Lets 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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, lets immediately return back to block editor and have a look at
these properties.


Fig. 6
Lets 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
0ynamIc Iocks 3

Erhan Toker
Architect
Autodesk Authorized Consultant
Software Specialist

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 weeks 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, lets add the LINEAR parameter as shown
in Fig. 2.

Fig. 2
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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. Lets 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. Lets 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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, lets enter block editor and draw a door as shown
in Fig. 6.

Fig. 6
This is a classical 9090 door. Now, lets 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 lets change its properties as `Flip
label=Left_Right, `Base state label=Left` and `Flipped state label=Right.
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.

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.
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
AutomatIc InsertIon angIe In 0ynamIc Iocks

Erhan Toker
Architect
Autodesk Authorized Consultant
Software Specialist


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, lets assign an ALIGNMENT parameter to the marked point (Fig. 3).

Fig. 3
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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. Lets 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.
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
0ynamIc Iocks and LDDKUP parameter


Erhan Toker
Architect
Autodesk Authorized Consultant
Software Specialist


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, lets 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
Try to keep insertion point as 0,0 point and the angle as shown in figure. After this,
lets 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, lets 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
www.dailyautocad.com
This document is compiled from the articles of the www.dailyautocad.com, which is copyrighted property of Talia Cad Software Ltd..
Copyright 1994-2006 Talia Cad Software Ltd.
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).