See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Formula help please

  1. #1
    I could stop if I wanted to
    Join Date
    2008-10
    Posts
    279


    Default Formula help please

    Hi all,

    I'm afraid I don't understand these conditional statements at all - and yes I have read the useless summary in the help file (they need to add a visual real world example, not just a bunch of hypothetical numbers...)

    I would like to make a void height parameter which will always be taller or as tall as 3 solid elements which have variable heights.

    So I want this void to always match the height of whichever solid is tallest at the time.

    In non-mathmatical terms, I need something like:

    Void height = The greatest of either A height, B height or C height

    Help would be great : )

    Cheers

  2. #2
    I could stop if I wanted to
    Join Date
    2008-10
    Posts
    279


    Default Re: Formula help please

    Could an IF statement work?

    Void Height = IF(A>B or C, A, B or C) (B>A or C, B, A or C) (C>A or B, C, A or B) ???

    I guess you can't have 'or' in a formula?

    My brain hurts...

  3. #3
    AUGI Addict jsteinhauer's Avatar
    Join Date
    2015-11
    Location
    Madison, WI
    Posts
    1,315


    Lightbulb Re: Formula help please

    You're formula doesn't make a lot of sense to me, because I don't know which one to pick, B or C. Revit my also be thinking (Which one do you want, 'B' or 'C'). You might try something similar to 'If(A>(B or C), A, B)'.

    Hope this helps,

    Jeff S.

  4. #4
    All AUGI, all the time Munkholm's Avatar
    Join Date
    2006-09
    Location
    The Kingdom of Denmark
    Posts
    560


    Default Re: Formula help please

    Jeff.

    I´m to tired to figure out how to do this in one line of formula, but it´s fairly easy, when using an extra calculation parameter

    Calc 1 = if(Solid A > Solid B, Solid A, Solid B)

    then

    Void Height = if(Calc 1 > Solid C, Calc 1, Solid C)

    Well, just look at the attached, and see for yourself
    Last edited by Munkholm; 2011-01-10 at 12:17 PM.
    - Klaus Munkholm

  5. #5
    All AUGI, all the time Ning Zhou's Avatar
    Join Date
    2006-08
    Posts
    613


    Default Re: Formula help please

    try that, not tested, 0.0 value is just a junk number (can be any number) because it will never be a case.
    H = if(or(A > B, A > C), A, if(or(B > A, B > C), B, if(or(C > A, C > B), C, 0.0)))

  6. #6
    All AUGI, all the time Ning Zhou's Avatar
    Join Date
    2006-08
    Posts
    613


    Default Re: Formula help please

    logically you also have to think the equal cases, like below:
    H = if(or(A > B, A > C, A = B, A = C), A, if(or(B > A, B > C, B = A, B = C), B, if(or(C > A, C > B, C = A, C = B), C, 0.0)))

  7. #7
    All AUGI, all the time Munkholm's Avatar
    Join Date
    2006-09
    Location
    The Kingdom of Denmark
    Posts
    560


    Default Re: Formula help please

    Joe.
    Just tested your suggestions, but in either case it´s not working when "C" is the greatest.... Been strugling my brain with it, and really dont see a way to do it, with just one line of code - It´s possible to test for several different conditions IF, AND, OR - but only possible to return a value for false, and one for true...
    Last edited by Munkholm; 2011-01-10 at 12:17 PM.
    - Klaus Munkholm

  8. #8
    All AUGI, all the time Ning Zhou's Avatar
    Join Date
    2006-08
    Posts
    613


    1 members found this post helpful.

    Default Re: Formula help please

    right, seems using "and" is more logically sound, try following to see if it works:
    1) no equal cases allowed
    H = if(and(A > B, A > C), A, if(and(B > A, B > C), B, if(and(C > A, C > B), C, 0.0)))
    2) equal cases also considered
    H = if(and(or(A > B, A = B), or(A > C, A = C)), A, if(and(or(B > A, B = A), or(B > C, B = C)), B, if(and(or(C > A, C = A), or(C > B, C = B)), C, 0.0)))
    again, not tested, give me a shout if it works.
    if it still doesn't work, then using family API will be a way out, i haven't tried API at family level yet.

  9. #9
    All AUGI, all the time Munkholm's Avatar
    Join Date
    2006-09
    Location
    The Kingdom of Denmark
    Posts
    560


    Default Re: Formula help please

    Joe.

    1) Works, unless there´s two equal numbers, then "0" is returned as the value.

    2) Works like a charm So I stand corrected !
    Last edited by Munkholm; 2011-01-10 at 12:17 PM.
    - Klaus Munkholm

  10. #10
    I could stop if I wanted to
    Join Date
    2008-10
    Posts
    279


    Default Re: Formula help please

    Hi guys,

    Thanks very much for all the input

    None of it makes much sense to me at first glance though... Like I said, I really don't get these statement formulas yet.

    I shall put my mathemetician hat on and have a play though.

    Thanks again

Page 1 of 2 12 LastLast

Similar Threads

  1. 2013: How to use this Formula,"Formula That Returns Strings"?
    By mike99 in forum Revit Architecture - General
    Replies: 4
    Last Post: 2013-01-09, 06:28 AM
  2. Yes/No Formula
    By lonewolfjustin in forum Revit MEP - Families
    Replies: 1
    Last Post: 2009-06-05, 12:21 AM
  3. Formula Help
    By stelthorst in forum Style Management
    Replies: 6
    Last Post: 2008-03-25, 05:07 PM
  4. Formula Use
    By jkrager in forum Revit Architecture - Tips & Tricks
    Replies: 0
    Last Post: 2006-01-20, 06:57 PM
  5. = a formula
    By GuyR in forum Revit Architecture - General
    Replies: 35
    Last Post: 2005-03-11, 08:24 AM

Posting Permissions

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