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
    1 Posts 1 Posters 1.1k Views 1 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

      (I posted this in the Materials group and am not receiving any replies. I thought it might actually be more suited to the DC group. Mea Culpa if duplicate posts are not allowed.)

      Hi everyone. I'm pretty new to SketchUp so I apologize in advance if this is a dumb or repeat question. I did search pretty much all day and have not found the answer yet, so I'm hoping someone can help me. Here is what I am doing. I have created a dynamic component that is a wall with various types and colors of cladding. I have created my "swatch" of colors/textures and I have attached it to my wall. I bundled the wall and swatch as a component. I have a user input drop-down at the parent level which asks the user if they want siding, brick veneer, stone veneer, or stucco. Each response has a value, 1-4. At the "Wall" child level I have an "onClick" Behavior that should allow the user to click through the various looks and shades for each of the cladding types based on their answer from the drop-down. To do this, I used the SET function but then nested IF statements within. It is going to the correct part of the SET function, but instead of cycling through the types of materials, it is trying to find a material with the name of the entire set. Here is a small example of what I am doing and how SU is responding: SET("Material",(IF(AG Wall!Ext_Cladding=1,("Siding_Light","Siding_Color_Med","Siding_Tan_Med","Siding_Dark"),IF(AG Wall!Ext_Cladding=2,("Brick_Light","Brick_Tan_Medium","Brick_Medium","Brick_Dark"),IF(AG Wall!Ext_Cladding=3,("sketch-stone_Light","Stone_Med","dark-sketch-stone"),("Stucco_Light","Stucco_Med","Stucco_Dark")))))) When, for instance, my user selects "Stucco", this is resolved to "4" but the "Material" Behavior displays Stucco_Light","Stucco_Med","Stucco_Dark just like that, without the beginning and ending double-quotes. So I know it is getting to the correct place, but why doesn't it read the list as a list and click through the options? I appreciate any help!

      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