sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Nested IF in a SET Function - what am I doing wrong?

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    11 Posts 4 Posters 9.2k Views 4 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.
    • C Offline
      CharlieGirl
      last edited by

      220 people so far have read this, but no one has replied. Does anyone have ANY ideas about this? I really appreciate any help with it. Are there Google SketchUp programmers that watch this forum? Do I need to contact Google directly? Help!

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        I read the original post once and thought it was too complex try and debug in a short amount of time. But I know its frustrating not getting help. So lets look at this. Do you have the component, or a test component you could upload here for us to look at?

        And to recap, what basic idea you want to have happen. The user chooses a material from a list and it gets applied to the component? Is it more than that?

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          I agree with Chris.
          The question is too complex.
          Supply a skp and some simple step-sheet explanations of what you expect the user to do and what should happen and what is happening - forget too much 'coding' initially...
          Then we can help you... ๐Ÿค“

          TIG

          1 Reply Last reply Reply Quote 0
          • C Offline
            CharlieGirl
            last edited by

            Thank you very much. I have attached my wall dynamic component.

            What I am trying to make happen is this:

            1. The user selects a siding type in the Component Options dialog box, brick, stucco, etc.

            2. The user interacts with the component by clicking on the wall and the wall cycles through the appropriate swatches to display the siding type as either light, medium, or dark.

            I have the swatches attached to the component and it works when I cycle through only one type, but when I nest my If statement, it stops working.

            I really appreciate you taking another look at this!

            1 Reply Last reply Reply Quote 0
            • Chris FullmerC Offline
              Chris Fullmer
              last edited by

              ok, so the user can select one a few different types of materials from a drop down menu. Then by clicking ont he component, the component should switch between light, medium and dark variations of the material.

              That should be do-able. I'll see if I can look through the component when I get a chance. Thanks for posting it,

              Chris

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • Chris FullmerC Offline
                Chris Fullmer
                last edited by

                ok, assuming I understood the problem at hand, I went ahead and made a DC that does what you want. The user can choose one of 4 colors from a list. Then upon OnClick'ing on the component, it changes between dark, medium, and light of that color. I'll attach the DC and you can check it out. Or if I get a chance, I'll look yours over and see if I can spot the error.

                Chris


                color_clicker.skp

                Lately you've been tan, suspicious for the winter.
                All my Plugins I've written

                1 Reply Last reply Reply Quote 0
                • C Offline
                  CharlieGirl
                  last edited by

                  Yes, you understand the desire perfectly. Thank you so much for your help! I'll look at what you created and compare it to mine to find the error. I really appreciate the time you have spent to help me out. I'll report back what I find (I'm sure I screwed something up!).

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    CharlieGirl
                    last edited by

                    Thank you! Your example code showed me that I should separate the material selection from the on-click function - I was trying to do too much at one time. I now have the nested IF for the material selection and the SET function is changing the color shade. That, plus for some reason it seems that I need to have a space between the front and back quote marks and the material names, seems to have fixed the issue. I really appreciate you revisiting my problem for me. Thank you again.

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      Oh good, glad you were able to look through my code and find the help you needed. I find that reading other people's DC code is often tedious...so I'm glad you were able to see what you needed.

                      Chris

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • SJS66S Offline
                        SJS66
                        last edited by

                        @chris fullmer said:

                        I went ahead and made a DC that does what you want. The user can choose one of 4 colors from a list. Then upon OnClick'ing on the component, it changes between dark, medium, and light of that color. I'll attach the DC and you can check it out.

                        Chris

                        Not only is he a fellow surfer with a cool hat, he's a sketchup legend. Love ya work mate!
                        Been searching for how to change materials by onclick all day. Doin' my head in.

                        Keep on paddling ๐Ÿ˜Ž

                        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