Announcement

Collapse
No announcement yet.

Conditional Statement Help

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

    Conditional Statement Help

    I'm making a cabinet family and am having trouble figuring out how to make an instance parameter to work.

    New family type is not going to solve it, unless I am missing the big picture.

    This is specifically for the side panel locations on each side. Each side has 3 configurations, so I actually have two separate parameters with the same condition.

    What I need it to be is something like this (forgive my lack of "if then" knowledge...severe n00b)

    If side panel offset = A Then Offset Length = 10mm

    Else If side panel offset = B Then Offset Length = 20mm

    Else If side panel offset = C Then Offset Length = 30mm

    I was looking at yes/no switches, which I think will work but clunky.

    I guess I was looking for a drop down selector to make that says "side panel a, b, or c"

    This would be RAC 2012

    I don't quite understand the Revit conditional statements yet. I found this formula in the wiki help, which isn't much help lol

    IF with logical OR: =IF ( OR ( A = 1 , B = 3 ) , 8 , 3 )

    #2
    Try this:
    IF(side panel offset = A,10,IF(side panel offset = B, 20, 30))

    or if you want to stop revit from giving an error when your input isn't A,B or C:

    IF(side panel offset = A,10,IF(side panel offset = B, 20, IF(side panel offset = C,30,0)))

    This formula will default to 0 if there's a wrong value for <side panel offset>.
    Martijn de Riet
    Professional Revit Consultant | Revit API Developer
    MdR Advies
    Planta1 Revit Online Consulting

    Comment


      #3
      Hi Kent, and welcome to RFO.

      Unfortunatly you can't make statements based on text parameters (As Martijn is suggesting above), and drop down selectors are not possible either.

      You could swap "A, B, C" with "1, 2, 3" and use a Integer instead of a Text parameter. Having done that, you can use a nested IF statement like in the attached.

      I've included 2 options, 1 with yes/no parameters, just in case you need those for visibility, and one just using the Integer.

      And just because we can, I've included an example on how to use the Integer to get the Text, should you need those for labels or schedules
      Attached Files
      Last edited by Munkholm; February 12, 2012, 02:58 PM.
      Klaus Munkholm
      "Do. Or do not. There is no try."

      Comment


        #4
        Thank you guys. I guess I should have said option 1,2 or 3. It will be a measurement offset is what I am trying to accomplish.

        I will play around with it some more, it looks like what both of you have shown will work one way or another. Intriguing how this all works.

        Comment


          #5
          Originally posted by Munkholm View Post
          Hi Kent, and welcome to RFO.

          Unfortunatly you can't make statements based on text parameters (As Martijn is suggesting above), and drop down selectors are not possible either.
          Sorry, my bad. I was assuming A, B and C were standing for different length values... need to stop drinking :whiskey:
          Martijn de Riet
          Professional Revit Consultant | Revit API Developer
          MdR Advies
          Planta1 Revit Online Consulting

          Comment

          Related Topics

          Collapse

          Working...
          X