Donate Now Goal amount for this year: 3000 USD, Received: 1207 USD (40%)

Results 1 to 6 of 6
Like Tree2Likes
  • 2 Post By amoursol

Thread: Help with IF statement?

  1. #1
    Member ryntau's Avatar
    Join Date
    October 11, 2012
    Location
    St. Louis
    Posts
    401
    Current Local Time
    09:59 AM

    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 Thumbnails Attached Thumbnails Help with IF statement?-ifthen.png   Help with IF statement?-ifthen02.jpg  

  2. #2
    jmk
    jmk is offline
    Forum Addict jmk's Avatar
    Join Date
    December 31, 2012
    Location
    NM, USA
    Posts
    1,415
    Current Local Time
    10:59 AM
    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 22nd, 2017 at 02:27 AM. Reason: clarify node vs parameer

  3. #3
    Forum Co-Founder Twiceroadsfool's Avatar
    Join Date
    December 7, 2010
    Location
    Dallas, TX
    Posts
    10,035
    Current Local Time
    11:59 AM
    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...

  4. #4
    Member ryntau's Avatar
    Join Date
    October 11, 2012
    Location
    St. Louis
    Posts
    401
    Current Local Time
    09:59 AM
    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 Thumbnails Attached Thumbnails Help with IF statement?-ifthen3.png  

  5. #5
    Forum Co-Founder Twiceroadsfool's Avatar
    Join Date
    December 7, 2010
    Location
    Dallas, TX
    Posts
    10,035
    Current Local Time
    11:59 AM
    Yeah, i like the FilterbyBool in case you want to do something ELSE to the others...

  6. #6
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    05:59 PM
    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 Thumbnails Attached Thumbnails Help with IF statement?-revitforumquery_if_statement.jpg   Help with IF statement?-revitforumquery_if_statement2.jpg  
    elton williams and ryntau like this.

Similar Threads

  1. IF Statement Help...
    By dynodan1uk in forum Architecture - Family Creation
    Replies: 11
    Last Post: April 21st, 2015, 09:58 AM
  2. If statement help
    By mkisno4 in forum Architecture - Family Creation
    Replies: 7
    Last Post: April 20th, 2015, 09:35 PM
  3. Variable 'If' Statement
    By Nevin in forum Architecture - Family Creation
    Replies: 1
    Last Post: June 5th, 2014, 06:25 AM
  4. IF statement help
    By dzatto in forum Architecture - Family Creation
    Replies: 4
    Last Post: August 16th, 2013, 03:59 PM
  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
  •