Announcement

Collapse
No announcement yet.

Formula Help - If statements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Formula Help - If statements

    I'm trying to put together a formula to calculate total exit width and have it almost there. The problem pops up when one or more of my fields does not have a value. With no value I get no result. I'm 99% sure an IF statement would fix it but I'm not sure on the implementation. I've looked at the forumla thread but algebra was never my strong suit...

    Formula: width1 + width2 = exit width

    if W1 and W2 have values it works fine: 1+1=2
    if W1 has a value, and W2 does not - I get nothing: 1+ =
    Last edited by cellophane; May 16, 2012, 02:41 PM.
    Revit for newbies - A starting point for RFO


    chad
    BEER: Better, Efficient, Elegant, Repeatable.

    #2
    In Revit you take a null value and do anything to it through a formula you get a null value in return. You will have to set your null to 0 to make it work.

    Comment


      #3
      Gotcha. Is it possible to ignore the null if it exists?
      Revit for newbies - A starting point for RFO


      chad
      BEER: Better, Efficient, Elegant, Repeatable.

      Comment


        #4
        Originally posted by cellophane View Post
        Gotcha. Is it possible to ignore the null if it exists?
        Not that I have ever figured out.

        Comment


          #5
          edit:
          Would it be easier to let the schedule total the value using the checkbox to "calculate totals" on the formatting tab?
          Last edited by Randy_CaS; May 16, 2012, 03:17 PM.

          http://www.captiveaire.com/
          Commercial Kitchen Ventilation Systems

          Comment


            #6
            I did but with multiple parameters I just wanted one value. I ended up just creating a parameter for my doors that added everything up in the family and scheduled the new parameter.
            Revit for newbies - A starting point for RFO


            chad
            BEER: Better, Efficient, Elegant, Repeatable.

            Comment


              #7
              try this (out of the top of my head):

              if(width1 >0,width1,0)+if(width2>0,width2,0)

              not sure if it will bite.
              You can do it for sure using calculated formulas but I'd have to check the syntax. I believe Gordon wrote a PotM nominee about it and I'm sure I used this trick in a blog post here once.
              Martijn de Riet
              Professional Revit Consultant | Revit API Developer
              MdR Advies
              Planta1 Revit Online Consulting

              Comment

              Related Topics

              Collapse

              Working...
              X