Creating dynamic blocks is an extension of creating static block definitions. You can make the process easier and more likely to succeed with sufficient planning, incremental changes, and testing in the Block Editor.
The following table provides an overview of the steps required to add dynamic behaviors and controls to a block definition.
Plan the block content | Plan how the block should change or move, and what objects will depend on the other objects. For example, you might decide that the block should be able to be resized in a specific direction, after which additional geometry is displayed. | |
Create the geometry | Create the geometric objects for the block in the Block Editor. If you plan to use visibility states to control when geometry is displayed, you might not want to include all the geometry at first. | |
Add geometric and dimensional constraints (not in AutoCAD LT) | It usually makes sense to add constraints to the geometry first, before adding parameters and actions. Specify the dimensional constraints from the Constraints tab on the Block Authoring palette. | |
Add parameters | Add parameters to specify which objects will be affected by an action. | |
Add actions | Add actions to define what will happen to the geometry when it is manipulated. | |
Define parameter properties | Add properties that determine how the block is displayed in the drawing area. Parameter properties affect grips, labels, and preset values for the block geometry. Consider how geometric objects might be affected if actions are chained together. | |
Test the block | On Block Editor contextual tab, Open/Save panel, click Test Block to test the block before you save it. A good practice is to test the block after each change to catch any errors early. | |
Save the block | On the Block Editor contextual tab, Open/Save panel, click Save Block or click in the Close panel, Close Block Editor and then click Save the Changes. |
The following is an example of adding constraints followed by adding actions and parameters.
In a block definition, constraints do the following:
The following illustration shows a block reference with two types of dimensional constraints used in a dynamic block.
The number of accessible grips on a constraint parameter is specified in the Properties palette from within the Block Editor.
After the block is inserted into the drawing, the constraints are maintained, but the value associated with d1 can be changed with the Properties palette in a similar manner to how you would change object properties.
In a block definition, actions and parameters provide rules for the behavior of a block once it is inserted into the drawing.
In general, you first create a parameter and then you associate an action to that parameter. A parameter is represented as a parameter point with one or more custom grips that display when the block is inserted into the drawing and selected.
When you insert the dynamic block in a drawing and manipulate one of its custom grips, the associated action determines what will change in the dynamic block. Just as with parameters, actions can be changed using the Properties palette from within the Block Editor.