Help with restricting movement of DYN Block objects

Help with restricting movement of DYN Block objects

jshimkus
Advocate Advocate
727 Views
15 Replies
Message 1 of 16

Help with restricting movement of DYN Block objects

jshimkus
Advocate
Advocate

To simplify my question, I have a block which consists of a polyline with 3 circles drawn along it.

I need this to be a dynamic block where the polyline ends can be moved (stretching the polyline) and the circles can be independently moved along the polyline, but not past, either end of the polyline.

 

I have attached a dwg with my attempt in it.

What i can not figure out is how to prevent the circles from moving past the right end of the polyline.

The circles must not be allowed to be moved outside of the endpoints of the polyline.

 

Is this possible?

0 Likes
Accepted solutions (3)
728 Views
15 Replies
Replies (15)
Message 2 of 16

Libbya
Mentor
Mentor

I don't believe that is possible.  The user simply needs to remain conscious and not pull the circles past the endpoint of the line.  I'd be happy to be proven wrong about that but I don't hold out much hope of that.  

0 Likes
Message 3 of 16

jshimkus
Advocate
Advocate

Dang!
I was hoping something clever could be done with the "Value Set" "Dist Maximum" where a formula could be used to look at a parameter.

 

Thanks for trying!

0 Likes
Message 4 of 16

j.palmeL29YX
Mentor
Mentor
Accepted solution

Attached a first attempt.  

 

>>Demo<<

 

 

Depending on how you want to use the block further improvements are possible. 

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.

EESignature

Message 5 of 16

jshimkus
Advocate
Advocate

Thanks so much!

That will work great!

Still going to try to figure out why it works because it seems rather simple.

0 Likes
Message 6 of 16

j.palmeL29YX
Mentor
Mentor

@jshimkus wrote:

 

Still going to try to figure out why it works ...


If you need further help to understand the suggestion feel free to ask again. 

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.

EESignature

0 Likes
Message 7 of 16

jshimkus
Advocate
Advocate

Can the left line endpoint can be dragged to a new location without moving the entire block, like the right end can be dragged?

 

What is the purpose of having the start points of the parameters offset 7" to the left of the line start point? 

 

0 Likes
Message 8 of 16

j.palmeL29YX
Mentor
Mentor
Accepted solution

@jshimkus wrote:

Can the left line endpoint can be dragged to a new location without moving the entire block, 

 


 

Try the attached block pa-test_2. 

The movement of the left end is limited currently to about 100' (feet).  If you need a wider range you can easily adjust the initial values in the block definition. 

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.

EESignature

0 Likes
Message 9 of 16

jshimkus
Advocate
Advocate

So, I spent Friday working on figuring your block out, and I think I have an understanding of most of it.

But how did you get the 100' line you drew for the colinear parameter to not show up in the block when inserted?

0 Likes
Message 10 of 16

j.palmeL29YX
Mentor
Mentor

@jshimkus wrote:

... how did you get the 100' line ... to not show up in the block when inserted?


In the block editor convert those geometry to construction line (that can also be done with arcs, circles, ...) . 

 

 

Constr-line.jpg

 

 

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.

EESignature

0 Likes
Message 11 of 16

jshimkus
Advocate
Advocate

Ahh!

Got it!

 

Thanks

0 Likes
Message 12 of 16

jshimkus
Advocate
Advocate

One more question...

How did you add the Horz. Contraints that hold the formulas without getting the Over constrained error ?

0 Likes
Message 13 of 16

j.palmeL29YX
Mentor
Mentor
Accepted solution

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.

EESignature

0 Likes
Message 14 of 16

jshimkus
Advocate
Advocate

Thanks for giving me the secret.

I have attached the version I have been working on and now it works well thanks to you.

But one final question.

How do I hide the blocks insert point grip so that I can grab the arrow grip underneath it on the leftmost circle?

0 Likes
Message 15 of 16

j.palmeL29YX
Mentor
Mentor

I don't know how to hide a blocks insert point grip, but you can place the grips of the parameters a little moved in vertical direction. 

 

moved grips.jpg

 

So also the grips of the polyline and the grips of the circles will never be overlapping. 

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.

EESignature

0 Likes
Message 16 of 16

jshimkus
Advocate
Advocate

Got it, Thanks!

0 Likes