Results 1 to 6 of 6

Thread: Confirmation nested parameter

  1. #1
    Member Infinite's Avatar
    Join Date
    November 19, 2019
    Location
    Utrecht
    Posts
    61
    Current Local Time
    01:55 PM

    Not allowed! Not allowed!

    Confirmation nested parameter

    Hi guys,

    How stupid is this formula?

    if(Diameter < 700 mm, (((Ext radius + Radius) / 2)-70 mm)), and(Diameter >700, Diameter<1600), (((Ext radius + Radius) / 2) -40 mm)), if(Diameter>1600, (Ext radius + Radius) / 2))

    So I'm meaning:

    If the diameter is less than 700, then the distance = x - 70
    If the diameter is between 700-1600, then the distance = x-40
    If the diameter is more than 1600, then the distance = x
    Last edited by Infinite; January 9th, 2020 at 09:36 AM.

  2. #2
    Member Infinite's Avatar
    Join Date
    November 19, 2019
    Location
    Utrecht
    Posts
    61
    Current Local Time
    01:55 PM

    Not allowed! Not allowed!
    Btw it says "comma not expected".

  3. #3
    Senior Member
    Join Date
    August 19, 2011
    Location
    New Hampshire
    Posts
    513
    Current Local Time
    09:55 AM

    1 Not allowed! Not allowed!
    You did not finish your formula string the first time around. It's missing the end "THEN" value and missing an if statement.

    You can end the formula at :

    if(Diameter < 700 mm, ((Ext radius + Radius) / 2)-70 mm, if(Diameter < 1600), ((Ext radius + Radius) / 2) -40 mm, (Ext radius + Radius) / 2))
    Last edited by Andrew K; January 9th, 2020 at 12:59 PM.

  4. #4
    Moderator DaveP's Avatar
    Join Date
    January 10, 2011
    Location
    St Paul, MN
    Posts
    3,222
    Current Local Time
    08:55 AM

    1 Not allowed! Not allowed!
    A formula debugger would be a great add!
    Haven't debugged your whole equation, but you could simplify it.
    You don't need the
    and(Diameter >700,
    or the
    if(Diameter>1600
    Formulas are parsed from left to right, so you've already gotten past the Diameter > 700 by your first test and the > 1600 by the second

  5. #5
    Forum Co-Founder Alfredo Medina's Avatar
    Join Date
    December 7, 2010
    Location
    Orlando, FL, USA
    Posts
    3,228
    Current Local Time
    09:55 AM

    2 Not allowed! Not allowed!
    Quote Originally Posted by Infinite View Post
    ...
    So I'm meaning:
    (...)
    If the diameter is between 700-1600, then the distance = x-40
    (...)
    I'd like to add these comments and questions:

    1) Instead of repeating
    (Ext radius + Radius) / 2
    every time you need it, it would be better to create a parameter such as "x", and make it equal to (Ext radius + Radius) / 2 ; so you just type x instead of that formula again. That would make the long formula easier to read and to debug.

    2) Notice that your formula won't do what you expect when Diameter is 700 or 1600 exactly, because you are excluding those values by doing this:

    and(Diameter >700, Diameter<1600)

    If the intention is "between 700 and 1600", shouldn't 700 and 1600 be included in that range?

    if that's the case, a better solution would be:
    and(not(Diameter < 700 mm), not(Diameter > 1600 mm))
    which means "at least 700 and no more than 1600"

    3) Shouldn't Diameter, Radius, and Ext Radius be related to each other by formula? It seems that Diameter can be changed independently without changing Radius, and vice versa, and it seems that nothing prevents the Exterior Radius to be smaller than the Interior Radius.

    4) Instead of Diameter, Radius and Exterior Radius, maybe you could have Inside Diameter and Thickness? just two parameters instead of three?

  6. #6
    Member Infinite's Avatar
    Join Date
    November 19, 2019
    Location
    Utrecht
    Posts
    61
    Current Local Time
    01:55 PM

    1 Not allowed! Not allowed!
    Quote Originally Posted by Andrew K View Post
    You did not finish your formula string the first time around. It's missing the end "THEN" value and missing an if statement.

    You can end the formula at :

    if(Diameter < 700 mm, ((Ext radius + Radius) / 2)-70 mm, if(Diameter < 1600), ((Ext radius + Radius) / 2) -40 mm, (Ext radius + Radius) / 2))
    So true. Stupid I haven't seen it yet. Thanks Andrew.

    Quote Originally Posted by DaveP View Post
    A formula debugger would be a great add!
    Haven't debugged your whole equation, but you could simplify it.
    You don't need the
    and(Diameter >700,
    or the
    if(Diameter>1600
    Formulas are parsed from left to right, so you've already gotten past the Diameter > 700 by your first test and the > 1600 by the second
    A debugger? That would be great! Your advice works well, never knew that. Thanks Dave!

    Quote Originally Posted by Alfredo Medina View Post
    I'd like to add these comments and questions:

    1) Instead of repeating
    (Ext radius + Radius) / 2
    every time you need it, it would be better to create a parameter such as "x", and make it equal to (Ext radius + Radius) / 2 ; so you just type x instead of that formula again. That would make the long formula easier to read and to debug.

    2) Notice that your formula won't do what you expect when Diameter is 700 or 1600 exactly, because you are excluding those values by doing this:

    and(Diameter >700, Diameter<1600)

    If the intention is "between 700 and 1600", shouldn't 700 and 1600 be included in that range?

    if that's the case, a better solution would be:
    and(not(Diameter < 700 mm), not(Diameter > 1600 mm))
    which means "at least 700 and no more than 1600"

    3) Shouldn't Diameter, Radius, and Ext Radius be related to each other by formula? It seems that Diameter can be changed independently without changing Radius, and vice versa, and it seems that nothing prevents the Exterior Radius to be smaller than the Interior Radius.

    4) Instead of Diameter, Radius and Exterior Radius, maybe you could have Inside Diameter and Thickness? just two parameters instead of three?
    1) True! I need to learn to combine parameters.
    2) Need to try that, but it sounds very reasonable.
    3+4) These parameters are dependent on each other, so you can change them independently, but the one is coming with the other one. Thickness is an easy solution for that. It's just a bit hard to think in radius-style when you always work with horizontal and vertical lines.
    The snaps to reference lines are very complicated too (for me as an ameteur ofc ).

    Thanks for the tips!
    Last edited by Infinite; January 13th, 2020 at 05:57 AM.

Similar Threads

  1. RTC: Speakers Confirmation Emails
    By RTC in forum Blog Feeds
    Replies: 0
    Last Post: March 29th, 2016, 10:15 PM
  2. Nested Family with YES/NO Parameter
    By Andres Franco in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: November 12th, 2015, 08:07 AM
  3. Nested family to cut parent with Y/N parameter
    By byk3bep in forum Architecture and General Revit Questions
    Replies: 6
    Last Post: December 17th, 2014, 04:06 PM
  4. Visibility parameter and nested family: bug?
    By jbenoit44 in forum Structure - Family Creation
    Replies: 4
    Last Post: August 30th, 2011, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •