# AddOptionList values

**URL:** <https://discourse.mcneel.com/t/addoptionlist-values/105301>\
**Category:** Rhino Developer\
**Tags:** python\
**Created:** [July 7, 2020, 12:10pm UTC](https://discourse.mcneel.com/t/addoptionlist-values/105301 "2020-07-07T12:10:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onrender](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/onrender/32/760722_2.png) [@onrender](https://discourse.mcneel.com/u/onrender)\
**Post date:** [July 7, 2020, 12:10pm UTC](https://discourse.mcneel.com/t/addoptionlist-values/105301/1 "2020-07-07T12:10:09Z")

</div>

Hi there,

Can someone help me? I put texts in the listValues inbetween two quotation marks, however the script does not work when I use space or put only number.

Works:  
listValues = “Solid”, “5mm” , “10mm”, “100mm”

It doesn’t work with space as “Solid geometry”  
listValues = “Solid geometry”, “5mm” , “10mm”, “100mm”

It doesn’t work with number as “100” instead of “100mm”  
listValues = “Solid geometry”, “5mm” , “10mm”, “100”

```
import Rhino
import rhinoscriptsyntax as rs

    def options():
        gs = Rhino.Input.Custom.GetString()
        prompt = gs.SetCommandPrompt("Specify profile? [Press ENTER]")
        listValues = "Solid geometry", "5mm" , "10mm", "100mm"
        listIndex = 0
        thickness = listValues[listIndex]
        opList = gs.AddOptionList("List", listValues, listIndex)
        while True:
            get_rc = gs.Get()
            if get_rc==Rhino.Input.GetResult.Point: # Alapertekkel (Default)
                print "Command line option values are"
                print " List =", listValues[listIndex]
            elif get_rc == Rhino.Input.GetResult.Option: # Ha belepunk a listaba
                if gs.OptionIndex()==opList:
                    listIndex = gs.Option().CurrentListOptionIndex
                    thickness = listValues[listIndex]
                continue
            elif gs.StringResult():
                thickness = gs.StringResult()
            break
    if __name__ == " __main__":
        options()
```

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [July 7, 2020, 5:49pm UTC](https://discourse.mcneel.com/t/addoptionlist-values/105301/2 "2020-07-07T17:49:36Z")

</div>

Hi @onrender,

There are limitations to the strings you can provide to [AddOptionList](http://GetBaseClass.AddOptionList).

_Must only consist of letters and numbers (no characters list periods, spaces, or dashes)_

– Dale
