Professional Documents
Culture Documents
AutoCAD® 2010
John Beltran - Autodesk
AU204-1L Learn how to improve your block libraries by creating Dynamic Blocks in AutoCAD 2010
through a series of hands-on exercises. You will learn how to create blocks with custom grips and
properties and how this can lead to block libraries which are smaller, easier to maintain, and more
flexible than libraries containing only traditional blocks. This class will benefit CAD professionals of all
industries, from the sole proprietor to CAD managers working with large teams of professionals.
Attendees should have a general knowledge of AutoCAD.
Dynamic block references may display themselves using different geometry than the geometry in the
original block definition. However, the displayed block reference remains a reference to the original block
definition.
In addition to the geometry contained in all block definitions, dynamic block definitions contain parameters
and actions. Parameters define custom grips and properties. Actions define how the geometry of a
dynamic block reference changes when you change a custom grip or property.
2
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
Tip: Double-clicking on a block in model or paper space launches the BEDIT command and selects
the corresponding block from the Edit Block Definition dialog box. You can disable this by setting
the BLOCKEDITLOCK system variable to 1.
3
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
4
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
In this lesson you will use the block editor to add a door handle to an existing block.
5. Examine the drawing and notice that all of the left-swing door block references now have door
handles.
5
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
6
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
Key Concept: Block parameters define what properties or grips can vary from one block
reference to another.
A dynamic block definition must contain at least one parameter. When a parameter is added to a dynamic
block definition, grips associated with key points of the parameter are automatically added.
Use the BPARAMETER command or the tools on the Parameters tab of the Block Authoring Palettes
window to add parameters to blocks.
7
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
In a drawing, you use a grip or a custom property in the Properties palette to manipulate a block
reference. When you manipulate a block reference in a drawing by moving a grip or changing the value of
a custom property in the Properties palette, you change the value of the parameter that defines that
custom property in the block. When you change the value of the parameter, it drives the action that is
associated with that parameter, which changes the geometry (or a property) of the dynamic block
reference.
Key Concept: Actions don’t appear outside of the Block Editor, but work behind the scenes like a
scripted command to manipulate the content of the block.
Most dynamic block actions take the place of commonly used AutoCAD commands and have the same
name as the command they mimic: MOVE, ROTATE, SCALE, STRETCH, ARRAY. You associate actions
with geometry. This geometry is modified when the actions are triggered.
Not all actions can be combined with all parameters, and some actions can only be used with a single
kind of parameter.
Use the BACTION command or the tools on the Actions tab of the Block Authoring Palettes window to
add actions to blocks.
8
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
In this lesson you will modify a section callout block so that the arrow designating the section direction
can be rotated separately from the other geometry in the block.
Notice the alert icon (exclamation point) displayed near the parameter. Hover over the alert icon
with your mouse and notice the tool tip that displays, describing a problem with the parameter.
Tip: Adding a parameter creates at least one label and one or more grips. You can select
and move the labels and grips independently after placing them.
9
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
10
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
7. Notice that the existing “Section” blocks at the bottom of the floor plan have been updated and
are now dynamic blocks.
Select the “Section” block at the bottom of the drawing and note the new rotation grip.
Pick the grip and verify that the arrow rotates as you move the grip without affecting the
attributes.
Extra Credit Update the block so that the arrow can only be rotated in increments of 45˚.
Enter bedit to edit the “Section” block
Enter properties (or ctrl+1) to display the Properties Dialog if it is not currently visible
Select the rotation parameter
In the Properties dialog change the “Ang Type” property to “Increment”
Change the “Increment” property to “45”. Notice the tic marks that now appear at 45˚
increments around the circumference of the rotation parameter
Enter bclose to exit the block editor. Don’t forget to save changes to the block.
Select the “Section” block again and test the rotation grip. Notice how the grip now snaps to
rotation angles in 45˚ increments.
11
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
12
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
In this lesson you will create a block for a stovetop that can represent either a gas or electric cooktop.
Tip: A block can contain only one visibility parameter. The Current Visibility State drop-
down list remains disabled until the block contains a visibility parameter. Every block
has a default visibility state called “VisibilityState0” that initially contains all of the
geometry, parameters, and actions in the block when you add a visibility parameter to
the block definition. This visibility state can be renamed.
Select the visibility parameter in the block definition, and change the Visibility Label to “Range
Type”.
13
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
14
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
Tip: Objects in a block can be in more than one visibility state, but only objects in the
current visibility state are normally visible in the Block Editor. You can control the
visibility of objects not in the current visibility state by changing the BVMODE system
variable setting.
Click the Visibility Mode button on the Block Editor ribbon to toggle the visibility of objects in
other visibility states on and off. Notice how the electric coils display in a dimmed color when
toggling BVMODE on. Leave the electric coils visible for now.
6. Add grids for a gas range top.
Enter insert on the command line and insert four copies of
the “Grille” drawing. Place each grille at the center of one of
the electric coils.
Click the Visibility Mode button to toggle BVMODE off and
hide the electric coils.
Use the Visibility States drop-down to toggle between the
Electric and Gas visibility states of the block. Verify that the
electric coils are only visible in the Electric state, and the
gas grilles are only visible in the Gas state.
Extra Credit: Add an Alignment Parameters to the back of the range. Alignment parameters define
custom grips which you use to automatically align the block to other geometry in your drawing when using
the grip to position the block. When you define an alignment parameter you must specify the alignment
axis. When you drag a block using an alignment grip AutoCAD rotates the block to make the alignment
axis is tangent to the geometry under the cursor.
15
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
For example you can define geometric relationships to keep two lines parallel, or perpendicular, or to
keep two circles concentric. You can define dimensional relationships that maintain the length of a line, or
that maintain the angle between two lines.
You can also define formulas that compute one relationship from another. For example you can require
the length of one line to be twice the length of another line, or you can require a rectangle to have a
constant area by defining relationships between the lengths of the sides.
AutoCAD provides a number of Dynamic Blocks features to leverage the power of constraints. These
include:
Geometric Constraints. You can define simple geometric relationships for geometry in your blocks
that AutoCAD maintains as you modify the block.
Constraint Parameters. Similar to Action Parameters, Constraint Parameters expose custom
grips and properties of your blocks, but use dimensional constraints to manage the geometry in
your block instead of block actions. Constraint Parameters can depend on each other through
expressions you define for the parameter variable.
Construction Geometry. AutoCAD allows you to convert regular geometry in your block definition
into construction geometry. AutoCAD hides construction geometry when you insert the block but
allows you to see and interact with it in the block editor. As the name implies you use construction
geometry to construct the location of other geometry in your block, and becomes particularly
useful when used with constraints.
Geometric Constraints
Geometric constraints define persistent relationships
based on basic geometric properties of the entity or
entities you apply them to. Geometric constraints can
be:
Coincident
Co-linear
Tangent
Perpendicular
Parallel
Horizontal (relative to the current UCS X axis)
Vertical (relative to the current UCS Y axis)
Concentric
Equal
Symmetric
Smooth
Fixed
16
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
The AUTOCONSTRAIN command examines entities you select and attempts to automatically constrain
the geometry based on its current position. The AUTOCONSTRAIN command never modifies the
geometry when applying geometric constraints. You can customize the type of geometric constraints the
command applies using the CONSTRAINTSETTINGS dialog.
Pitfall: AUTOCONSTRAIN helps you to save time by applying constraints in simple and
obvious situations, but avoid the temptation to use it everywhere. Always verify the
constraints created but AUTOCONSTRAIN and do not be tempted to blindly apply it to
your entire drawing.
The GEOMCONSTRAINT command creates geometric constraints individually. It prompts for the
constraint type to create and for the geometry to apply the constraint to. When the geometry does not
satisfy the newly applied constraint AutoCAD modifies the geometry satisfy the constraint. When applying
constraints between two entities AutoCAD modifies the second entity selected and leaves the first entity
unmodified if possible.
17
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
You remove all constraints on an entity using the DELCONSTRAINT command. You cannot remove
individual constraints using the DELCONSTRAINT command.
18
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
Constraint Parameters
Constraint Parameters define parameters that control geometric
properties of geometry in your block without using actions.
Constraint parameters come in many of the same forms as
associative dimensions:
Aligned
Horizontal
Vertical
Radial
Diameter
Angular
You define constraint parameters using the BCPARAMETER
command.
Just like regular parameters, constraint parameters define custom grips and properties for the block.
Constraint parameters also define an expression which can be used to compute the value of the property.
The expression can be a constant (e.g. “5.0”), in which case you can modify the value after inserting the
block. If the expression is not constant (for example “Height = Width + 5”) the value cannot be modified
directly after inserting the block, but is computed from the value of other custom properties (e.g. “Width”).
19
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
Traditionally you managed construction geometry using special layers where you placed the construction
geometry and controlled the visibility of the geometry by managing the layers. While functional this
approach takes time to maintain and can lead to errors in your printed documents when layers are left on,
etc.
With the BCONSTRUCTION command you convert regular entities into construction entities, and you can
revert constcution entities back into regular entities. You also use the command to show or hide all
construction geometry in the block.
AutoCAD draws the geometry with a hidden line type and with a “dimmed” color
AutoCAD keeps construction geometry on layer 0. If you change the layer of a construction entity
AutoCAD puts it back on layer 0 the next time you open the block in the editor.
AutoCAD makes construction geometry visible when you open a block in the block editor.
Tip: Think of construction geometry as an invisible “skeleton” that you use to control the
behavior of the visible geometry in the block.
Use construction geometry for hidden symmetry lines, to measure distances to fixed points in the block,
or to act as “levers” on other geometry that you could not easily constrain otherwise.
The example at right uses construction
geometry to measure the distance from the
end of a bolt to the opposite side of a bend.
A tangent constraint between the
construction line and the arc causes it to
act as a lever between the dimensional
constraint and the arc. A vertical constraint
on the construction line keeps it properly
aligned, even if the radius of the arc
changes.
20
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
In this lesson you will use constraints to control the location of the electric coils on a stove top relative to
the overall width of the stove.
21
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
22
Hands-on Introduction to Dynamic Blocks in AutoCAD® 2010
23