In the last post, I started the process of creating a dynamic block breakline, beginning with stretching the right end of the line. Here's where we left off:
Now let's go get the other side.
I prefer to have the left and right sides of the breakline stretch independently. Sometimes, things just aren't symmetrical. So to stretch the left side, I'll just repeat the process from last time.
- Create a linear parameter from the center of the breakline to the left end.
- Double-click the exclamation point and choose Stretch.
- Select the left-hand grip as the associated parameter point.
- Draw the stretch window around the left end of the breakline.
- Select the polyline as the object to stretch.
- Select the parameter and use the Properties palette to set the number of grips to 1.
And here's what I get:
If you like shortcuts (and who doesn't?), there's a "Linear Stretch" item on the "Parameter Sets" tab of the Block Authoring Palette. It does steps 2, 3, and 6 for you.
Maybe in your world, though, your breaklines are always symmetrical. In that case, there's no need for a second parameter. Here are two ways you can create symmetric stretching with one parameter and two actions.
1. Use a stretch action on the Distance 1 parameter with either a distance multiplier of -1 or an angle offset of 180 degrees.
This method uses the same parameter and associated point as the first stretch action, but the stretch window is on the other end.
The other difference is in the action's properties. When the right end moves right, the left end needs to move left (and vice versa). To make this happen, you can either give the action a distance multiple of -1, or an angle offset of 180 degrees. It doesn't matter which one you use.
Now we have a block with one grip that moves both ends.
2. Adjust the Distance1 parameter to have 2 grips and a base location of "midpoint", and use the action from method 1.
Until now, we've been stretching linear parameters from what's called the "startpoint", or the first defined point of the parameter. But you can also have linear parameters that stretch symmetrically from their midpoint.
First, I'll adjust the location and properties of the Distance1 parameter.
Notice that the exclamation point is back, and that the blue "x" is still in the center of the polyline. (Before, it was attached to one end of the Distance1 parameter.)
Next, I'll create the stretch action for the left side of the breakline, making sure that the "associated point" is the left end of the parameter.
I don't have to do anything special to the action -- it automatically moves the correct way.
In this configuration, moving either grip also adjusts the other side, so that the breakline once again stays symmetric.
In the next post, I'll show you how to add the optional rotation action and parameter.