Donate Now Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

Results 1 to 5 of 5
Like Tree2Likes
  • 1 Post By amoursol
  • 1 Post By Mimi Azimar

Thread: If Else Statement

  1. #1
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    03:27 AM

    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? I mean like if true go to this node else go to that node.

    I actually have problem something like this:

    if true i want A list else B list.
    Attached Thumbnails Attached Thumbnails If Else Statement-if.png  
    Last edited by Mimi Azimar; May 25th, 2017 at 07:27 AM.

  2. #2
    jmk
    jmk is offline
    Forum Addict jmk's Avatar
    Join Date
    December 31, 2012
    Location
    NM, USA
    Posts
    1,423
    Current Local Time
    09:27 PM
    I've had issues with if logic in the code block, so I usually use the "Formula" node. In it you can use syntax like you would in Revit - if(a, b, c)

  3. #3
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    03:27 AM
    same result.

    Attached Thumbnails Attached Thumbnails If Else Statement-if-else-formula.png  

  4. #4
    Senior Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    612
    Current Local Time
    04:27 AM
    Hello jmk,

    The inherent logic behind 'if statements' in Dynamo is a little out of whack - there is a reason for it (And I did get told once) that makes sense, but it doesn't comply with how if logic in Revit works.

    To achieve such, use the following node from the Zebra package by my colleague Mark Thorley.

    Attached Thumbnails Attached Thumbnails If Else Statement-revitforumquery_if_statement.jpg  
    Mimi Azimar likes this.

  5. #5
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    03:27 AM
    Thanks a lot Amoursol, I love the design script, giving me ideas for other problems.
    amoursol likes this.

Similar Threads

  1. Help with IF statement?
    By ryntau in forum Dynamo BIM
    Replies: 5
    Last Post: February 22nd, 2017, 08:49 AM
  2. IF Statement Help...
    By dynodan1uk in forum Architecture - Family Creation
    Replies: 11
    Last Post: April 21st, 2015, 09:58 AM
  3. If statement help
    By mkisno4 in forum Architecture - Family Creation
    Replies: 7
    Last Post: April 20th, 2015, 09:35 PM
  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, 09: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
  •