Nested IF in a SET Function - What am I doing wrong?
-
(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!
Advertisement