# Stuck on choose Function

**URL:** <https://forums.sketchup.com/t/stuck-on-choose-function/38836>\
**Category:** Dynamic Components\
**Created:** [February 9, 2017, 5:43pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836 "2017-02-09T17:43:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 5:43pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/1 "2017-02-09T17:43:00Z")

</div>

Hi All,

I’m trying to make a simple AV Screen with a drop down option list for the different sizes (32",42" etc).  
I want the choice effect both the overall width and height.  
The drop down value is linked to the overall width, so that’s covered.  
I’ve linked the OPTION INDEX to the “TVSize”,which is the name of the custom field for the dropdown list.  
Then i’ve added =Choose value to the LenZ field with 2 values which relate to the widths of the 2 screen sizes in the dropdown option.  
I can’t seem to find the error involved, any help would be great.

Many Thanks in Advance  
Adam  
[test tv.skp](https://forums.sketchup.com/uploads/short-url/csHRuYEL789pzFK2zYGweurnUg5.skp) (237.6 KB)

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [February 9, 2017, 7:47pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/2 "2017-02-09T19:47:22Z")

</div>

Your formula in TVHeight uses a curly/smart quote. (Not smart in this case) 😉

> [@FACEAREA function has me pulling my hair out! All I get is errors!](https://forums.sketchup.com/t/facearea-function-has-me-pulling-my-hair-out-all-i-get-is-errors/35691/6):
>
> The problem is the double quote character you are using. If you don’t know anything about programing this may not mean much to you. But notice the difference between the starting and ending quote. This just shows the difference of the ASCII value. [image] This was a huge difficulty for me to figure out the first time I used a Mac. The more I edited things the more things broke…

---

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 8:53pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/3 "2017-02-09T20:53:04Z")

</div>

Cheers Neil,  
I’d of never seen that.  
I had to delete and replace the quote a number of times til they the same type.

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 9:15pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/4 "2017-02-09T21:15:56Z")

</div>

On Mac these smart Quotes can be toggled on /off in MAC-System- Preferences-Keyboard-Text,  
you should uncheck when working with formulas  
Also ; You’ve set TVHeight to OPTIONINDEX (‘TVSIze’) but the values of the list options off that attribute contains actual lengths in CM, not : 1,2,…N (Integer list options) .  
Now, the CHOOSE function in lenZ can’t ‘choose’ so it pops an error

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [February 9, 2017, 9:29pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/5 "2017-02-09T21:29:30Z")

</div>

It would be nice if the DC would be smart enough to out smart the smart quotes! 🙂 Maybe I should file a feature request? Even though for myself I have outgrown the DC’s and don’t use them anymore.

---

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 9:37pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/6 "2017-02-09T21:37:58Z")

</div>

I also messed up some of the naming, so it got stuck in a loop.  
The lengths in cm is the result I was aiming for, so if say 42" size was selected in the options, then it would give a value for the screen width and the choose/choose index would produce the screen height result.  
I guess they may be a better way to approach this.  
Basically I want to be able to select a screen option from a list and is would effect the width and height of the model.

Cheers  
Adam

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [February 9, 2017, 9:41pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/7 "2017-02-09T21:41:50Z")

</div>

> [@adamb2016](#):
>
> I also messed up some of the naming, so it got stuck in a loop.

How did you get it to do that?

![](https://global.discourse-cdn.com/sketchup/original/3X/e/8/e80962102b54fb57850ce9dffc29820f98e6e53c.png)

---

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 10:06pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/8 "2017-02-09T22:06:13Z")

</div>

This is my end result.  
Just need to add a few sizes to the lists and build the rest of the screen parts.[test tv v2.skp](https://forums.sketchup.com/uploads/short-url/ypeLOu0PskbmjcD1rwjMvuweWR7.skp) (234.2 KB)

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 10:07pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/9 "2017-02-09T22:07:02Z")

</div>

I can’t see the formula, only the error. Probably you should use CURRENT(“X”) instead of X.  
for the TV you should also consider Aspectratio.

 ![](https://global.discourse-cdn.com/sketchup/original/3X/1/4/14c32617d4f5cbc35d7aaf7cfbbef863b28ae1fb.gif)

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 10:12pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/10 "2017-02-09T22:12:01Z")

</div>

I did’t bother to remove the TVHeight formula , instead I used LenZ and LenX to get the Height and Width.

---

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 10:12pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/11 "2017-02-09T22:12:40Z")

</div>

Wierd, this is what I see.

 ![](https://global.discourse-cdn.com/sketchup/original/3X/7/3/7395110fce01565701c4b842f6295861ed85fc05.png) ![](https://global.discourse-cdn.com/sketchup/original/3X/f/8/f8c0b0f6482fa4e96ecea7c2fd280c39bc2ca10f.png)

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 10:18pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/12 "2017-02-09T22:18:24Z")

</div>

You must set the Values in the list options to Integer numbers, otherwise , CHOOSE can’t ‘choose’

[SketchUp functions](http://help.sketchup.com/en/article/114561)

How is the CHOOSE-function gonna choose index number 73.8 (the outcome of attribute index) from a list with two options?

---

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 10:27pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/13 "2017-02-09T22:27:35Z")

</div>

So is there an better way to use a dropdown list/value that can give a value for LenZ and LenX?

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 10:43pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/14 "2017-02-09T22:43:42Z")

</div>

The user of the DC chooses an option ( in this case 32’’ or 42’') these are two options , so I would assign the values of those options in the Attribute’s list options dialog.(1 and 2)  
You could then easily choose the corresponding Height (in LenZ) and Width (in LenX) with the CHOOSE-function.  
for LenZ:  
CHOOSE(“option number of User selected choice”, “Heigth if option number=1”,“Height if option number=2”)[test tv3.skp](https://forums.sketchup.com/uploads/short-url/3gguD9CBgBGRduHsyXXfjJ6bgff.skp) (233.1 KB)

Combining the two functions would give:

CHOOSE(OPTIONINDEX(“User’s choice in INTEGER number”), “Length if User chose option 1”, “Length if user chose 2”)

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 11:23pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/15 "2017-02-09T23:23:46Z")

</div>

You should consider this:  
The User of the DC chooses an option: 32’’ inch or 42’’  
but this Size is the **diagonal** of the screen ( which is dependant of LenX and LenZ) and I don’t want the User to let him choose the LenX **and** LenZ so I must use the choice of the User (option 1 **or** 2) in two formulas: one for LenX and one for LenZ  
With the optionindex, I can put the corresponding values of the User’s choice in any other Attribute.

---

<div class="post-metadata">

**Author:** ![adamb2016](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/adamb2016/32/25286_2.png) [@adamb2016](https://forums.sketchup.com/u/adamb2016)\
**Post date:** [February 9, 2017, 11:32pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/16 "2017-02-09T23:32:02Z")

</div>

That all makes sense, thanks Mike for helping me through this and for all your detailed descriptions.  
You’ve taught me something new 🙂

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 9, 2017, 11:38pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/17 "2017-02-09T23:38:21Z")

</div>

We all gain here something : I for one , am trying to learn how to explain!

---

<div class="post-metadata">

**Author:** ![Zarloff](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@Zarloff](https://forums.sketchup.com/u/Zarloff)\
**Post date:** [October 11, 2017, 7:40pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/18 "2017-10-11T19:40:14Z")

</div>

Thanks all. I was able to use this discussion to create an adjustable stair that works with our adjustable height staging.

Finally here is the component!

[24-40in Adjustable Stairs.skp](https://forums.sketchup.com/uploads/short-url/fThfXgfWLZV3RpWiMTsXlKFyKya.skp) (2.3 MB)

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [October 11, 2017, 9:41pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/19 "2017-10-11T21:41:31Z")

</div>

Thanx for sharing!  
Well done!!

 ![ChooseHeight](https://global.discourse-cdn.com/sketchup/original/3X/f/1/f11b19ce4995a65a0088306147fa731fd69cc243.gif)

---

<div class="post-metadata">

**Author:** ![Zarloff](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@Zarloff](https://forums.sketchup.com/u/Zarloff)\
**Post date:** [October 12, 2017, 3:53pm UTC](https://forums.sketchup.com/t/stuck-on-choose-function/38836/20 "2017-10-12T15:53:06Z")

</div>

Hi:

Thanks, was interesting getting everything to work together.  
Would have been nice if instead of an array in the line, we could create a table and have it pull from the table, think Excel.

Thanks,

Kevin Schmidt
