Announcement

Collapse
No announcement yet.

Help with IF statement?

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

    Help with IF statement?

    I was hoping someone could help me with a simple If/Then statement in Dynamo. I'm trying to figure this out for learning purposes and can't figure out why it's not working. My goal with what you see attached, is for all Rooms larger than 500sf, to turn on a LargeArea parameter (yes/no). For some reason, it's turning all of them on. Any help would be appreciated.
    Attached Files
    Ryan Taube
    BIM Manager - Clayco Construction | Lamar Johnson Collaborative

    #2
    It's setting the parameter before it gets to the "if" node. I haven't used the if node successfully before, but I'd try having only one "set parameter" node, and feeding the value from the if node, with 0 and 1 being fed in as the true/false.
    Last edited by jmk; February 22, 2017, 02:27 AM. Reason: clarify node vs parameer
    Julie Kidder
    Architect + BIM Director
    Hartman + Majewski Design Group

    Comment


      #3
      As a learning exercise I can't help, but it seems like you could just Filter by Bool Mask, and send the two outputs to the Set parameter options...
      Aaron "selfish AND petulant" Maller |P A R A L L A X T E A M | Practice Technology Implementation
      @Web | @Twitter | @LinkedIn | @Email

      Comment


        #4
        I think i was making more complicated than i needed. The Bool Mask method works, but i think this way is easier.. Since The Greater Than node returns a true/false value, i just plugged that straight into the 'value' for the Element.setparameterbyname. i've attached what i did.
        Attached Files
        Ryan Taube
        BIM Manager - Clayco Construction | Lamar Johnson Collaborative

        Comment


          #5
          Yeah, i like the FilterbyBool in case you want to do something ELSE to the others...
          Aaron "selfish AND petulant" Maller |P A R A L L A X T E A M | Practice Technology Implementation
          @Web | @Twitter | @LinkedIn | @Email

          Comment


            #6
            The OOTB If node doesn't behave very well for the revit style use case unfortunately. You could use DesignScript as follows:



            In this case, we're using the code format to query the following: Thing - Query - and - Thing - Other query ? if true for both : if not true for both.

            Is the area greater than or equal to (>=) ten (10) AND (&&) less than or equal to (<=) twenty (20), which is capped with a question mark (?).
            We then stipulate our two end conditions: What happens if true for both (middle), broken by a colon (:) an what happens if not true for both (outer).

            If you wanted to use nodes instead, you could use Mark Thorley's Logic.If node in the Zebra package.

            Attached Files

            Sol Amour

            Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
            Portfolio Website @ Cargo Collective

            Comment

            Related Topics

            Collapse

            • If Else Statement
              Dear Dynamo Experts,

              I have a simple question on if statement. How to implement something like if true do A things, else do B things in dynamo?...
              May 25, 2017, 08:19 AM
            • How to Use IF Statements in DynamoBIM
              Simply Complex: Its easy to use IF Statements in DynamoBIM.
              All you need if 4 components

              1. two nodes to compare. These are usually...
              April 1, 2015, 06:45 AM
            • Rhythm FamilyInstances.Room
              I'm stumped why the FamilyInstances.Room node below returns all nulls.
              This is a small snip of a larger graph. I've removed anything downstream...
              December 4, 2019, 03:50 PM
            • Resize nodes?
              Is there a way to Re-size a node once it's been placed in a graph?
              Specifically, I'd like to stretch out some of my Watch nodes so I don't have...
              February 11, 2016, 07:34 PM
            • GetSurroundingElements Node Not Working
              Anyone have any ideas on why the get surrounding elements node would be failing me here in the attached script image? I know it use to work and it works...
              October 25, 2016, 09:23 PM
            Working...
            X