A static block with dynamic properties is known as a dynamic block. Dynamic blocks can contain properties to show/hide, stretch, move, rotate, mirror, and scale geometry in a block.
For example, you can have a single dynamic block that contains a stretchable property to represent windows of different widths in a plan or elevation view.
In this article, you'll create a window block that starts with a size of 36" wide x 72" high, and then:
Add a linear parameter
Add a stretch action
Test the block
and more ...
Note: The video doesn't contain audio or closed captions.
Note: Steps, images, and videos may differ slightly from your version of the product.
Create a Block
In a blank drawing, draw a 36x72 rectangle to represent the window. Draw the inner rectangles as shown. Place the lower-left corner of the window at 0,0. This location will be used as the block's base insertion point.
Enter a block name. Use a name that indicates the block's use.
Click Select Objects.
The dialog box closes temporarily so you can select the objects.
Select the objects drawn to represent the window and press Enter.
The dialog box reopens.
Check Open in Block Editor.
Click OK to close the dialog box.
The Block Editor environment opens and the Block Editor ribbon tab displays.
If the Block Authoring Palette is not open, click
Block Editor tab > Manage panel
> Authoring Palettes.
Find
Make it Stretchable
Now you are ready to define the dynamic part of this block. For a stretchable block, you'll need a parameter and an action.
Parameter. Parameters determine the geometry that are affected by an action when you manipulate a block reference.
Action. Actions define how the geometry of a dynamic block reference moves, stretches, or changes when its grips are manipulated.
Add the Parameter
First, you'll add a linear parameter so that the geometry is limited to linear movement.
Make sure that you are in the block editor environment as described previously or select an existing block reference in the drawing, right-click, and choose Block Editor.
On the Block Authoring palette, click
Parameters tab > Linear.
Specify the upper-left corner of the outer rectangle for the first location.
Specify the upper-right corner of the outer rectangle for the second location.
Specify a location for the parameter.
Show me how to add the parameter
Add the Action
Parameters are used to get input from the user, but without an action a parameter doesn't do anything. For our window example, a stretch action will allow us to stretch and move geometry based on the properties of the linear parameter.
On the Block Authoring palette, click
Actions tab > Stretch.
Follow the prompts on the command line:
Select parameter: Select the Distance1 parameter.
Specify parameter point to associate with action or enter [sTart point/Second point] <Start>: Specify the point at the right parameter grip (a red X appears when you move your cursor near it).
Specify first corner of stretch frame: Pick above and near the center of the window, as shown.
Specify opposite corner: Pick below and to the right of the window, as shown.
Select objects: Use a crossing-window to indicate the entire right half of the window, then press Enter to finish object selection.
An action icon is shown next to the parameter grip it is associated with.
The block is now ready to use, but let's test it first.
Note: If you want to stretch the block from the left side, add a stretch action to the left parameter grip.
Move the mouse to stretch the block or enter a specific width.
Click
Close panel > Close Test Block.
Click
Block Editor tab > Close panel > Close Block Editor.
Save the changes when prompted.
Show me how to test and save
Stretch Both Sides from One Linear Grip
Now let's say you want both sides to stretch simultaneously when you drag the right grip. This can be done by adding another stretch action to the same linear parameter. This action will apply to the other side of the window. Start with the dynamic block you created previously.
Note: You could move all the geometry over to the left 18" so that 0,0 is at the midpoint of the bottom line of the window. This would keep the block centered around its insertion point when stretched. However, these examples show the insertion point in the lower left.
Select the block, right-click, and choose Block Editor.
On the Block Authoring palette, click
Actions tab > Stretch.
Follow the prompts on the command line:
Select parameter: Select the Distance1 parameter added previously.
Specify parameter point to associate with action or enter [sTart point/Second point] <Start>: Pick the same parameter grip as before.
Specify first corner of stretch frame: Pick above and near the center of the window, as shown.
Specify opposite corner: Pick below and to the left of the window, as shown.
Select objects: Use a crossing-window to indicate the entire left half of the window, then press Enter to finish object selection.
We actually want the objects to stretch in the opposite direction from the objects on the right side, for example when the grip is dragged to the right the objects stretch to the left. Do define this, modify the Angle Offset property of the action as shown.
If the Properties palette isn't open, click
View tab > Palettes panel > Properties.
Find
Click the stretch action icon you just added so that its properties are shown in the Properties palette.
Note: Make sure that Stretch Action is shown as the object type in the Properties palette.
Set the Angle Offset to 180 on the Properties palette. This causes the selected objects to stretch in the opposite direction when you drag the linear grip.
Test the block as described previously.
Note: If you are going to try the next exercises, you should delete the second stretch action since it won't be needed.
Right-click the action icon that was just added.
Choose Delete.
Show me how to add the second stretch action
Stretch Block in Increments
Let's say you only want to allow windows between 24" and 60" wide in 6" increments. You can define the stretch parameter to limit the stretch action.
If the block isn't open in the Block Editor, double-click the stretchable window created previously and click OK to edit the block.
Select the linear parameter, Distance1, right-click, and choose Properties.
Locate the Value Set section.
Select Increment from the Dist Type drop-down.
Enter 6 as Dist Increment.
Enter 24 as Dist Minimum.
Enter 60 as Dist Maximum.
Test the block as described previously. Notice the faint white lines limiting the increments that are allowed.
Stretch Block using a List of Values
Instead of stretching at increments, maybe you only want to allow windows that are 24", 36", or 48" wide.
If the block isn't open in the Block Editor, double-click the stretchable window created previously and click OK to edit the block.
Select the linear parameter, Distance1, right-click, and choose Properties.
Locate the Value Set section.
Select List from the Dist Type drop-down.
Click the button next to the Dist Value List box.
Add 24 and 48 on the Add Distance Value dialog box and click OK. 36 is added automatically since that's the length of the linear parameter.
Test the block as described previously. Again, notice the faint white lines limiting the sizes that are allowed.
Dynamic blocks can be very useful and save you from creating hundreds of static blocks. Creating a stretchable block may seem complicated at first, but just remember the basics; add a parameter, apply an action, test the block.
Note: This article was originally published in 2017 and was one of our first Have You Tried articles. We've updated it based on your feedback. More details have been added, along with a section on creating a block that stretches equally in two directions when dragging a single grip. We've also added some short videos at the end of several sections that demonstrate the steps.