sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Help with IF function

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    6 Posts 3 Posters 1.7k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      twdant
      last edited by

      I understand how to use the IF function, but I'm having trouble figuring out how to produce the required TRUE value for the first IF argument.

      I need a formula that will return a TRUE value if the COPY attribute of a repeating subcomponent is equal to a certain number. Is there a function that will give me a TRUE value if two attributes are equivalent?

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        So for an attribute named "Value"

        Value: =IF(COPY = 2, TRUE, FALSE)

        will return TRUE if COPY i equal to 2 and FALSE otherwise. Have I misunderstood the question?

        Hi

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          There is no == double-equal comparison operator in Dynamic Components. It is just =

          http://help.sketchup.com/en/article/114563

          (There should be < and <= on the linked page.)

          Hi

          1 Reply Last reply Reply Quote 0
          • P Offline
            pgarmyn
            last edited by

            @jim said:

            There is no == double-equal comparison operator in Dynamic Components. It is just =

            http://help.sketchup.com/en/article/114563

            (There should be < and <= on the linked page.)

            Answered too fast, without reading completely.... sorry..

            1 Reply Last reply Reply Quote 0
            • P Offline
              pgarmyn
              last edited by

              @jim said:

              So for an attribute named "Value"

              Value: =IF(COPY = 2, TRUE, FALSE)

              will return TRUE if COPY i equal to 2 and FALSE otherwise. Have I misunderstood the question?

              Wrong answer :

              %(#999999)[Maybee it should be (?):
              Value=IF(COPY == 2, TRUE, FALSE)
              But this will also work (shorter=better?) :
              Value=(COPY == 2)]

              Correction : this is for ruby, not for dynamic components

              1 Reply Last reply Reply Quote 0
              • P Offline
                pgarmyn
                last edited by

                Wrong answer :
                value1==value2 will return TRUE or FALSE

                Correction : this was for ruby, not for dynamic components

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement