Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
Like Tree4Likes

Thread: Nested Conditional statement

  1.    #11
    Senior Member
    Join Date
    December 16, 2010
    Posts
    530
    Current Local Time
    04:47 AM
    Quote Originally Posted by duende123 View Post
    First.

    You can not modify the value of a parameter using the parameter itself in the formula that modifies its value
    So we are going to have 2 different parameters.
    Angle (real value)
    ANGLE (fixed value)
    To the latter we assign the formula:

    if(Angle < 22.5░, 90░, if( Angle < 35░, 30░,if(Angle < 67.5░ , 45░, 90░ )))


    IF angle is less than 22.5░: ANGLE = 90░
    else
    IF angle is less than 35░: ANGLE = 30░
    else
    IF angle is less than 67.5 : ANGLE = 45░
    else
    ANGLE = 90░
    Yes that is exactly how I used it.
    But thanks for clarifying for the others that may read the post.

    Actually I just tested your formula out also - although it does work (as in Revit accepts it as valid)
    It is not correct for my needs, basically the minimum angle I can have is 30 degrees. I probably need to change the other formula down to 1 degree minimum.

    if(and(Angle > 1.5░, Angle < 35░), 30░, if(and(Angle > 35░, Angle < 67.5░), 45░, if(and(Angle > 67.5░, Angle < 90░), 90░, 0░)))

    Then in my schedule I can filter out any results that report 0 so they don't figure in my lists.
    Last edited by Karalon10; July 14th, 2017 at 12:56 PM.

  2.    #12
    Moderator cellophane's Avatar
    Join Date
    August 9, 2011
    Location
    Louisville, KY
    Posts
    5,312
    Current Local Time
    02:47 PM
    Quote Originally Posted by duende123 View Post
    So we are going to have 2 different parameters.
    Angle (real value)
    ANGLE (fixed value)
    just my $0.02: I would not create the additional parameter(s) just by capitalizing the name. Adding a descriptive suffix is a much better method in the long run. It will help you later when you need to go back and edit the family and it is more consistent on the user end of things.

    Angle
    AngleCalc

    Sidenote: When I'm working with longer formulas I will copy them into Notepad++. It has syntax highlighting so you can see where your expressions start & stop and make sure all of your parenthesis have a mate.
    Attached Thumbnails Attached Thumbnails Nested Conditional statement-notepadformula.png  
    duende123 and Karalon10 like this.

  3.    #13
    Member duende123's Avatar
    Join Date
    November 20, 2015
    Posts
    109
    Current Local Time
    02:47 PM
    That's the cherry on the ice cream...

    or BEER

  4.    #14
    Member
    Join Date
    November 23, 2012
    Posts
    63
    Current Local Time
    11:47 AM
    I've never seen any resources from Adesk or anywhere else where this Revit formula system is described.

    I know Adesk documentation is horrible, but there's zero written down about this anywhere - It's bad even by Adesk's low standards. Am I missing something?

    Is there somewhere where this syntax is charted out and can be learned? Or is it all some standard coding syntax that is obvious to people who 'do code stuff'?
    Last edited by bt.comm; July 17th, 2017 at 06:06 AM.

  5.    #15
    Senior Member
    Join Date
    December 16, 2010
    Posts
    530
    Current Local Time
    04:47 AM
    Quote Originally Posted by bt.comm View Post
    Is there somewhere where this syntax is charted out and can be learned? Or is it all some standard coding syntax that is obvious to people who 'do code stuff'?
    https://www.revitforum.org/tutorials...day-usage.html

    The above thread has the absolute basics outlined, although it does not describe WHY or the logic behind how things work but has some basic examples which I have used on several occasions as a basis or start point but usually it is when things go off this path that I get totally lost and come here for help.

    I did C++ programming WAY back in uni like 20 years ago (and I was never very good at that back then either) so yes there are a lot of similarities in the "logic" or what the computer expects to see. Essentially it is basic coding, but if you never did any basic coding then....you are out in the dark. I'm wondering if there are any good textbooks or resources around that someone can recommend for the basics?

  6.    #16
    Member duende123's Avatar
    Join Date
    November 20, 2015
    Posts
    109
    Current Local Time
    02:47 PM
    Karalon:
    Try this formula ...

    if(Angle < 1.5░, 0░, if(Angle < 35░, 30░, if(Angle < 67.5░, 45░, if(Angle < 90░, 90░, 0░))))


    Bt.comm:

    look here...
    https://www.augi.com/articles/detail/formulas-families

    Not everything, but to start is good.
    I help you with whatever you need
    Last edited by duende123; July 17th, 2017 at 12:38 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Conditional IF statement
    By Karalon10 in forum Architecture and General Revit Questions
    Replies: 8
    Last Post: April 24th, 2017, 03:22 PM
  2. Yes/No Parameter in Conditional Statement
    By keithwales in forum Architecture and General Revit Questions
    Replies: 3
    Last Post: September 16th, 2014, 05:00 PM
  3. Conditional Statement question
    By BLothian in forum Architecture - Family Creation
    Replies: 15
    Last Post: May 15th, 2014, 03:34 PM
  4. Visibility Yes/No Conditional Statement
    By Lisa in forum Architecture - Family Creation
    Replies: 9
    Last Post: February 11th, 2014, 12:29 AM
  5. Conditional Statement Help
    By Kent in forum Architecture - Family Creation
    Replies: 4
    Last Post: February 12th, 2012, 10:07 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
  •