Quick Start to Creating Dynamic Blocks

You add dynamic behavior to new or existing block definitions by adding parameters and actions to the block in the Block Editor. In the following example, a desk block is shown in the Block Editor. The block contains a linear parameter, which displays similar to a dimension and is labeled “Distance,” and a stretch action, which displays a lightning bolt and a “Stretch” label.

For a block to be dynamic, you must add at least one parameter. You then add an action and associate the action with the parameter. The types of parameters and actions you add to the block definition define how the block reference will work in a drawing.

Process for Creating Dynamic Blocks

To create quality dynamic blocks, so you get the results you expect, it is recommended that you follow the steps in the following process. This process will help you author dynamic blocks effectively.

Step 1. Plan the contents of the dynamic block before you create it

Before you create a dynamic block, you should know what it will look like and how it will be used in a drawing. Decide which objects within the block will change or move when the dynamic block reference is manipulated. Furthermore, decide how these objects will change. For example, you might create a dynamic block that can be resized. In addition, when the block reference is resized, additional geometry may be displayed. These factors determine the types of parameters and actions you add to the block definition, and how you make the parameters, actions, and geometry work together.

Step 2. Draw the geometry

You can draw the geometry for your dynamic block in the drawing area, the Block Editor contextual tab, or the Block Editor. You can also use existing geometry in a drawing or an existing block definition.

NoteIf you will use visibility states to change how geometry is displayed in the dynamic block references, you may not want to include all the geometry at this point. For more information about working with visibility states, see Create Visibility States.

Step 3. Understand how the block elements will work together

Before you add parameters and actions to your block definition, understand their dependencies on each other and on the geometry within the block. When you add an action to the block definition, you will need to associate the action with a parameter and a selection set of geometry. This creates a dependency. When you add multiple parameters and actions to a dynamic block reference, you will need to set up the correct dependencies in order for the block reference to function properly in a drawing.

For example, you create a dynamic block that contains several objects. Some of the objects have a stretch action associated with them. You also want all the objects to rotate around the same base point. In this case, you should add the rotate action after adding all the other parameters and actions. If the rotate action isn't associated with all of the other objects (geometry, parameters, and actions) in the block definition, parts of the block reference may not rotate or manipulating the block reference may cause unexpected results.

Step 4. Add parameters

Add the appropriate parameters to the dynamic block definition, following the prompts at the Command prompt. For more information about using parameters, see Add Action Parameters to Dynamic Blocks.

NoteYou can use the Parameter Sets tab of the Block Authoring Palettes to add a parameter and an associated action at the same time. For more information about using parameter sets, see Use Parameter Sets.

Step 5. Add actions

Add the appropriate actions to the dynamic block definition. Follow the prompts at the Command prompt, making sure to associate the actions with the correct parameters and geometry. For more information about using actions, see Overview of Using Actions.

Step 6. Define how the dynamic block reference will be manipulated

You can specify how the dynamic block reference will be manipulated in the drawing. You can manipulate a dynamic block reference through custom grips and custom properties. When you create a dynamic block definition, you define what grips are displayed and how they edit the dynamic block reference. You also specify whether or not custom properties for the block will be shown in the Properties palette and whether or not these properties can be changed through the palette or through custom grips.

Step 7. Test the block

On the ribbon, in the Block Editor contextual tab, Open/Save panel, click Test Block to test the block before you save it.

See Also