Greater than formula for paramter

Greater than formula for paramter

Anonymous
Not applicable
7,285 Views
13 Replies
Message 1 of 14

Greater than formula for paramter

Anonymous
Not applicable

Is there a formula for a parameter if a pipe size is larger than a certain size it will add length to the current value to make the length longer?

 

Example,

 

Line size is 1.5" and I have a width of 2" and need to add 2" to width if line size becomes 2" or larger.

 

Thanks,

0 Likes
Accepted solutions (1)
7,286 Views
13 Replies
Replies (13)
Message 2 of 14

ToanDN
Consultant
Consultant

Sorry for double replies

Message 3 of 14

ToanDN
Consultant
Consultant

If ( 0<line size<2", line size+.5", line size+2")

Message 4 of 14

Alfredo_Medina
Mentor
Mentor

That formula is incorrect. It gives the error of "Improper use of boolean expressions".

 

Maybe this is what @Anonymous is trying to do for the Width parameter?

 

if(not(line size < 2"), line size + 2", line size)


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
0 Likes
Message 5 of 14

ToanDN
Consultant
Consultant
You are correct. Revised below:

if(line size < 0' 2", line size + 0' 0 1/2", line size + 0' 2")
Message 6 of 14

Anonymous
Not applicable

You can do IF(AND(0<Line Size,Line Size<2"), ResultIfTrue, ResultIfFalse) but that depends on what you are trying to accomplish.

 

If you want to round to every increment of 2" you would create a parameter "Actual Line Size"=ROUNDUP(Line Size/2")*2". Then 1 1/2"/2 = 0.75 which rounds up to 1. 1*2=2. 6-1/2"/2"=3.25, 3.25 rounds up to 4, 4*2"=8"

0 Likes
Message 7 of 14

Alfredo_Medina
Mentor
Mentor

@Anonymous , @ToanDN

 

Please notice that the request in the original message says "...need to add 2" to 'width' if 'line size' becomes 2" or larger."

 

Therefore,...

1) if the value of "line size" is less than 2", "width" should not be modified.

2) if the value of "line size" is 2, "width" should be increased by 2".

3) If the value of line size is greater than 2", "width" should be increased by 2", as well.


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
0 Likes
Message 8 of 14

ToanDN
Consultant
Consultant

@Alfredo_Medina

 

You could be right.  I will let OP clarify if he needs to.

 

From my point of view, this sort of rules is very common when creating penetrations for pipes, ductwork, or conduits.

For smaller pipes (less than 2" diameter, the holes diameters only need to be 1/2" larger the pipes'.  For larger pipes (2" or over), the holes' diameters need to be 2" larger than the pipes' to give enough room for adjustment, caulking, and whatnots.

 

They align with requirements you would find in the UL systems.

0 Likes
Message 9 of 14

Alfredo_Medina
Mentor
Mentor

My point is, that, regardless of the practical applications of the formula, the IF statement has to include the the value of 2" as a condition to do something, not just the values less than 2". In one of the formulas shown above the conditional statement says "if this parameter is less than 2", do this, otherwise do that". The other formula says "if this parameter is greater than zero and less than 2", do this, otherwise do that". None of these formulas is considering that the request was "if this value is 2" or greater", do this, do that", which is different. 


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
0 Likes
Message 10 of 14

ToanDN
Consultant
Consultant

@Alfredo_Medina wrote:

My point is, that, regardless of the practical applications of the formula, the IF statement has to include the the value of 2" as a condition to do something, not just the values less than 2". In one of the formulas shown above the conditional statement says "if this parameter is less than 2", do this, otherwise do that". The other formula says "if this parameter is greater than zero and less than 2", do this, otherwise do that". None of these formulas is considering that the request was "if this value is 2" or greater", do this, do that", which is different. 


It does.

 

Width:  if(line size < 0' 2", line size + 0' 0 1/2", line size + 0' 2")

 

If line size < 2" then Width = line size + 1/2".  Else, Width = line size + 2".

 

What do you think Else is there for?  Of course, it is there to address the condition of line size = or > 2".

Message 11 of 14

RDAOU
Mentor
Mentor

Hmmmm...


if(not(line size < 2"), line size + 2", line size) @Alfredo_Medina

 

if(line size < 0' 2", line size, line size + 0' 2") @ToanDN

 

I believe both are correct statements to achieve the same end result...well They give the same output..., one says if it is not less (i.e.: only greater) do something and the second says if it is less do nothing!!! 

 

However, The OP is variating the width by +2" to its original value and not to the line size i.e.: width cannot be equal to width + 2" (circular chain)


@Anonymous wrote:
Is there a formula for a parameter if a pipe size is larger than a certain size it will add length to the current value to make the length longer?

Example,

Line size is 1.5" and I have a width of 2" and need to add 2" to width if line size becomes 2" or larger.
  • An additional parameter should be added to control width
  1. Parameter "Width" for the user to input value 
  2. Parameter "Width_CTRL" which labels the dimension on the drawing (i.e.:controls width of the pipe placed in the model
  • use any of the above formula formats amended as follows
  1. Width_CTRL = if(not(line size < 2"), Width + 2", Width)
  2. Width_CTRL = if(line size < 2", Width, Width + 2")

 

=> user inputs both values or both values are given (Line size and Width)....formula compares and amends Width_CTRL in the model

 

or at least that's how I understand the request 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


Message 12 of 14

Anonymous
Not applicable
Accepted solution

I have used this formula and it works great.

 

if(Parameter> #, Parameter, Parameter +#)

 

in use would say

 

if(Nom Dia > 1 1/2", Nom Dia, Length +2")

Message 13 of 14

Alfredo_Medina
Mentor
Mentor

To help with the discussion, this is a comparison of the 3 formulas presented above, with an initial as a suffix at the end of the parameter.

 

  • I added the "result if true" and "result if false".to the width_test_J parameter, since it was not specified.
  • There are 2 formulas that work correctly for all 3 conditions. One of them does not work when the value is less than 2".
  • I agree that in reality, to change the actual width of something, we would need another parameter.

 

2017-02-09_8-01-49.png


Alfredo Medina _________________________________________________________________ ______
Licensed Architect (Florida) | Freelance Instructor | Profile on Linkedin
0 Likes
Message 14 of 14

RDAOU
Mentor
Mentor

What's the conclusion? The outputs of the following conditional statements are not the same? Or what? 

 


if(not(line size < 2"), line size + 2", line size) 

if(line size < 2", line size, line size + 2") 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes