How to use user input value, multiply this value by 5 then stretch block that has multiple objects with new value?

How to use user input value, multiply this value by 5 then stretch block that has multiple objects with new value?

CoraForun
Enthusiast Enthusiast
207 Views
7 Replies
Message 1 of 8

How to use user input value, multiply this value by 5 then stretch block that has multiple objects with new value?

CoraForun
Enthusiast
Enthusiast

 

This is a simple dynamic block with a stretch parameter. However, I want to make it more advanced. 
What I need:

  • In the properties tab, I want the user to input a length value.
  • I want the stretch parameter to use this value and multiply it by 5.
    • Exemple: User enters 2 in the properties tab. Block length is now 10m long.

Note: The insert point of the block is at 0,0 and the stretch is done going downward. So if the input value is 2, I need the block to stretchs 10m south (X: 0, Y: -10).
How can I achieve that? 


I tried using vertical constraint parameter and it partly worked, but it seems that constraints parameters only works on single objects and only lines, polylines and arcs... I have text, hatch, an attribute and a visibility state in the block.

0 Likes
208 Views
7 Replies
Replies (7)
Message 2 of 8

MMcCall402
Mentor
Mentor

How about a second linear parameter and stretch action with a distance multiplier of 5.  Use the current parameter as the selection set and chain its action.  The user can set the value of this parameter in the property window and it will operate the first one by a multiplier of 5.

 

 

Mark Mccall 
CAD Mangler


EESignature


VHB - Vanasse Hangen Brustlin, Inc.


Linkedin

0 Likes
Message 3 of 8

CoraForun
Enthusiast
Enthusiast

Hello, thanks for you reply. Would be kind of you to do a demo. Are you sure this is supposed to work? It doesn't work for me. I do a linear stretch, I select every object to be stretch and set Chain Actions to Yes, but when I test, nothing moves. 

CoraForun_1-1752683186344.png

 

CoraForun_2-1752683306694.png

 




0 Likes
Message 4 of 8

MMcCall402
Mentor
Mentor

This what I was thinking:  The stretch on the left stretches the objects at a 1x multiplier.  The stretch on the right stretches the stretch on the left at a 5x multiplier, which then stretches the objects that same amount.  The left parameter is hidden from the user, only the one on the right is visible.

 

MMcCall402_0-1752689049062.png

 

Mark Mccall 
CAD Mangler


EESignature


VHB - Vanasse Hangen Brustlin, Inc.


Linkedin

0 Likes
Message 5 of 8

j.palmeL29YX
Mentor
Mentor

@CoraForun wrote:


I tried using vertical constraint parameter and it partly worked, ...


If you consider a constraint based solution (additional to Marks suggestion), please post your current not yet properly working attempt. So we can see what is going wrong. 

 

 

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 6 of 8

CoraForun
Enthusiast
Enthusiast

Thank you for your help! I tested your block but when I enter 2 in Enter_Distance, the result is 6. 

0 Likes
Message 7 of 8

Brock_Olly
Collaborator
Collaborator

Because the base distance is 1. Stretch one then 1x5=5 -> add both = 6

0 Likes
Message 8 of 8

j.palmeL29YX
Mentor
Mentor

Attached an attempt using constraints. 

The vertical dimension is for testing purposes only and should be deleted in the final version. 

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