Announcement

Collapse
No announcement yet.

Revit Formulas for "everyday" usage

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Alfredo Medina View Post
    Odd or Even

    To determine if an integer "n" is odd or even:

    if(-1 ^ n = 1, "even", "odd")

    [ATTACH=CONFIG]38855[/ATTACH]

    See attached Revit family.
    except the neutral integer "0"


    Sent from my ANE-LX2 using Tapatalk

    Comment


      I think I already know but checking to make sure. Can one make an IF statement check for a certain value (or specific string) in a text parameter? I don' t think it's possible but if there is a way I would love to know how. Thanks!

      Comment


        I'm afraid your are right there Sander. Can't use a string in an IF statement as far as I know.
        Might need to get that one on the Revit Roadmap as well
        Company Website: www.deurloobm.nl
        Revit Ideas: Is this family Mirrored? | Approve warnings | Family Type parameter just those in the family

        Comment


          Here are MSword and PDF files of the formulas.
          Attached Files

          Comment


            Hi folks,

            Quick question - do the logical operators "AND" and "OR" accept more than two conditions?
            I'm under the impression they only accept two conditions like the below:
            Code:
            and(<condition 1>, <condition 2>)
            Currently, to accept more than two conditions, I write as follows:
            Code:
            and(and(<condition 1>, <condition 2>), <condition 3>)
            With all the parametric heavy families I've created so far, it appears to work no problem.

            Thanks.

            Comment


              Yes, OR and AND may have multiple conditions, like this:
              and(A, B, C, D) ; this will be true only if all four values are true.
              or (A, B, C, D) ; this will be true if at least one of the four values is true.

              2021-06-06_9-36-45.jpg
              Freelance BIM Provider at Autodesk Services Marketplace | Linkedin

              Comment


                Originally posted by Alfredo Medina View Post
                Yes, OR and AND may have multiple conditions, like this:
                and(A, B, C, D) ; this will be true only if all four values are true.
                or (A, B, C, D) ; this will be true if at least one of the four values is true.

                2021-06-06_9-36-45.jpg
                Thank you, Alfredo, for the example & confirming my suspicions.

                Comment

                Related Topics

                Collapse

                Working...
                X