Formula to Calculate a Stretch Action from User Input Parameters

Formula to Calculate a Stretch Action from User Input Parameters

apweng
Collaborator Collaborator
2,625 Views
9 Replies
Message 1 of 10

Formula to Calculate a Stretch Action from User Input Parameters

apweng
Collaborator
Collaborator

Hello,

 

I am wondering if a stretch parameter can reference a formula based on user input.

 

For example if I had a rectangle block - the user input would be the following:

  • material thickness (mt) for the Y dimension
  • vertical exaggeration (ve)

Can I stretch the rectangle block in the Y direction that is based on a value of mt*ve?

 

For context I am creating a block for geotechnical soil borings where user inputs the material thicknesses (multiple materials are accommodated with multiple visibility states).  It works fine if there is no vertical exaggeration but if the vertical exaggeration is 10:1 I would like to scale the stretch parameter (mt) by a user defined parameter (ve).

 

Not sure how I could accomplish this with dynamic block.

 

Any suggestions most appreciated - thanks!

 

Andrew

 

 

0 Likes
2,626 Views
9 Replies
Replies (9)
Message 2 of 10

Libbya
Mentor
Mentor

Here are two ways.  Either way could prove difficult depending on the complexity of the actual block.  The dynamic parameter/action version has the downside of the mt*ve being wrong if someone edits that parameter directly rather than editing the other two.  The constraints version has the mtXve parameter value uneditable and solely dependent on the two individual values.  

 

 

0 Likes
Message 3 of 10

apweng
Collaborator
Collaborator

Hi there Libbya that is very nice - thank you very much - I really appreciate the time you put into this!

 

I do like the constraint option better (I have yet to work with constraints) but I'm not sure if this will work with my block visibility states.  The block that I'm working with (attached) has 10 visibility states (10 different materials which stacks the rectangles on top of eachother) - and if change the material thickness of the top material, then the underlying material thicknesses should remain unchanged.  This is done with a combined stretch and move action.

 

Do you think I could accomplish with constraints or would this require the parameter / action pair method.

 

 

Thanks again for your help!

 

Andrew

 

 

0 Likes
Message 4 of 10

Libbya
Mentor
Mentor

Can you backsave?  I'm still on 2017.  TrueView can't convert it to a workable block file.

0 Likes
Message 5 of 10

apweng
Collaborator
Collaborator

Sure here is a 2017 version.

 

Thanks again!

 

Andrew

 

 

0 Likes
Message 6 of 10

Libbya
Mentor
Mentor

If you combine what I show here with what I showed previously, you should be able to accomplish all of it.

 

 

0 Likes
Message 7 of 10

apweng
Collaborator
Collaborator

Hello again Libbya - thanks again for the follow up video - I am making progress.

 

Another few questions for when you have a moment.

 

  1. Can a block prompt for a parameter (VE Vertical Exaggeration) upon insertion?
  2. Can the calculated distance constraint be hidden from AutoCAD Properties?

Thanks,

 

Andrew

 

 

0 Likes
Message 8 of 10

Libbya
Mentor
Mentor

I do not know of a way within stock autocad to prompt for a parameter value on insertion.  You can prompt for attribute values, but the attribute value cannot drive a parameter.

0 Likes
Message 9 of 10

Libbya
Mentor
Mentor

And, YES, the calculated distance constraint can be hidden.  Within block editor select the constraint, then go to properties, then find the setting for 'show in properties' and select NO.  It will no longer appear in properties when the block is selected in model space.  

0 Likes
Message 10 of 10

CoraForun
Enthusiast
Enthusiast

Would it be possible to do the same exemple but with Civil 3D 2025? I've watch this for over an hour and mt and ve don't multiply. Any idea how to stretch from north to south? Base point is 0,0 so how to multiply and stretch a negative result?

0 Likes