Let's reveal the "secret".
To control geometry with grips we need constraint parameters.
To drag both ends of the polyline to the left and the right and because a dimension can never be smaller than 0 I placed the basepoint for these Parameters (Parameter "Left" and Parameter "Right") far away to the left (and hope the user will never have to reach this point).
Next, (to move the circles/blocks): Each constraint parameter needs some object it is assigned to. Therefore I first created 3 dummy objects (points). The grips of these horizontal constraint parameters (d1, d2, d3) move these dummy objects. (To hide this points I set PDMODE to 1. I could just as well have converted the points to construction geometry).
Next I added dimensional constraints d4, d5 and d6 to the circles.
The value of these dimensions is a formula:
Example:
To be sure that d4 will never be greater then "Right" set
d4=min(Right;d1). [d4 -> Position of the circle, d1 -> Position of the Grip]
That means while d1 (the position of the Grip) is smaller than "Right", than d4=d1. If d1 will be greater than "Right" then d4=Right.
For the left side we must be sure that d4 will never be smaller than "Left". So we must write: d4=max(Left;min(Right;d1)).
The same for the other both circles.
Because we use Horizontal Constraint Parameters and horizontal Rotated Dimensions (Dynamic) we have no problem to stay the geometry horizontal (better: along the polyline) while dragging.
HTH
Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
