See the top rated post in this thread. Click here

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

Thread: Formula Question

  1. #1
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    208
    Login to Give a bone
    0

    Default Formula Question

    Ok, I'm still rather new to labels and formulas.
    What I want is to have a Height Label that allows the user only a limited range.
    If I knew what I was doing it would look like the following:
    Height=>17 or <19.
    Another might be:
    Length = >36 or <42.
    How would I write these formulas?

    Thanks.

  2. #2
    AUGI Addict bowlingbrad's Avatar
    Join Date
    2003-11
    Location
    Chicago
    Posts
    1,233
    Login to Give a bone
    0

    Default Re: Formula Question

    Here's an option to use:
    Attached Images Attached Images

  3. #3
    100 Club
    Join Date
    2006-01
    Location
    Macau
    Posts
    117
    Login to Give a bone
    0

    Default Re: Formula Question

    could you explain a little bit more.
    what's text cal for ? and what's the 1,0 at the end of formula for ?
    Best wishes

  4. #4
    All AUGI, all the time Elmo's Avatar
    Join Date
    2005-04
    Location
    South Africa
    Posts
    959
    Login to Give a bone
    0

    Default Re: Formula Question

    This should do the trick. Make sure that Condition is the parameter that actually contolling your Height length.
    Attached Images Attached Images

  5. #5
    100 Club
    Join Date
    2004-08
    Posts
    107
    Login to Give a bone
    0

    Default Re: Formula Question

    Wow it is neat to see these formulas! My question for Elmo is why does "Height" have to go at the end of the formula? But this would illustrate my confusion on formulas... so let me ask this:

    is there a source to share this really useful syntax info? Is there a Formulas How-To, or tutorial somewhere? I have not been able to get as advanced as these If Then statements without any precedents. How did you all figure it out? Is this just Programming 101 that I am missing?

    Nice work.

  6. #6
    All AUGI, all the time davidcobi's Avatar
    Join Date
    2005-03
    Location
    Greater Los Angeles
    Posts
    546
    Login to Give a bone
    0

    Default Re: Formula Question

    Goto Revit Help and search for "Conditional Statements in Formulas" and "Valid Formula Abbreviations". Also see:

    http://revitoped.blogspot.com/2005/1...p-my-mind.html

  7. #7
    Revit Technical Specialist - Autodesk Scott D Davis's Avatar
    Join Date
    2003-04
    Location
    Chino, CA
    Posts
    4,756
    Login to Give a bone
    0

    Default Re: Formula Question

    Quote Originally Posted by Cheuk Ling
    could you explain a little bit more.
    what's text cal for ? and what's the 1,0 at the end of formula for ?
    Best wishes
    The 1,0 are the values that Revit will use if the conditions are met or not.

    IF (<condition>, <result-if-true>, <result-if-false>)

    In this case, the 1 is the <result-if-true> and the 0 is the <result-if-false>

    In the example:

    =if(and(Height > 17', Height < 19'), 1, 0)

    The <condition> is (and(Height > 17', Height < 19') which is evaluating two things, if Height is greater than 17' AND if Height is less than 19'. If that condition is met, then Revit returns the value 1, and if not true Revit returns the value 0.

  8. #8
    I could stop if I wanted to TroyGates's Avatar
    Join Date
    2015-08
    Location
    Irvine, CA
    Posts
    281
    Login to Give a bone
    2

    Default Re: Formula Question

    To explain Elmo's...

    Height = value you want to control
    Condition = formula based on Height's value, assigned to the dimension as its parameter

    To break down the formula...

    if (Height < 17', 17', if (Height > 19', 19', Height))
    If the value of Height is less than 17', make the value of Height 17'. So if the user puts in 16' for the height, it will change it to 17'.

    If the value of Height is more than 19', make the value of Height 19'. So if the user puts in 20' for the height, it will change it to 19'.

    If the value of Height is between 17' and 19', it retains its value. So if a user puts in 18', the value of Height stays at 18'.

  9. #9
    100 Club
    Join Date
    2004-08
    Posts
    107
    Login to Give a bone
    0

    Default Re: Formula Question

    Thanks David, the Help file strikes again. Man, I wish I could just quit my job and study the help file for a month or so. I think I could learn a ton!

    Anyone want to finance me? [grin]

    In the meantime, the other REVIT users are providing some great feedback on the formulas. Thank you. however, you all have not really answered my question which is why does the word Height appear at the end of the formula. I get the IF this, THEN that part of the formula. But what is the last slot say Height again?

    Thanks again. This has been quite helpful. As a reward you can all take the rest of the day off. Tell 'em I said so.

  10. #10
    Revit Technical Specialist - Autodesk Scott D Davis's Avatar
    Join Date
    2003-04
    Location
    Chino, CA
    Posts
    4,756
    Login to Give a bone
    0

    Default Re: Formula Question

    The Height at the end is <result-if-false> This is a Nested Conditional formula. It's really a "double IF" statement. If THIS or IF THAT, then do THIS-HERE, if not either, then just give me the Height. Here's the breakdown:

    if (Height < 17', 17', if (Height > 19', 19', Height))

    First: Height < 17', 17', First, check if Height is less than 17', if so, then return the Value 17'
    Next: if (Height > 19', 19', if Height is not less than 17', then check the next expression, which is to see if Height is greater than 19' feet...if it is, return the value 19'
    Finally: Height)) If neither of those expressions is true, the Height at the end will return the Actual Height value.

    Less than 17', return 17 feet. Greater than 19', return 19'. If between 17' and 19', return the value defined as Height, which could be any value in between.

    Make sense?
    Last edited by Scott Davis; 2006-07-11 at 12:05 AM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Simple Formula Question
    By jsteinhauer in forum Revit Architecture - General
    Replies: 7
    Last Post: 2012-07-20, 02:53 AM
  2. Formula question
    By AdamCP in forum Revit - Platform
    Replies: 4
    Last Post: 2011-11-02, 04:56 PM
  3. Another formula question
    By gbrowne in forum Revit Architecture - Families
    Replies: 11
    Last Post: 2009-11-05, 05:30 AM
  4. Formula Question
    By raddis in forum Revit Architecture - General
    Replies: 5
    Last Post: 2006-07-10, 08:04 PM
  5. Formula question
    By david.kingham in forum Revit Architecture - Families
    Replies: 5
    Last Post: 2005-12-23, 11:35 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
  •