# Figures via drop-down menu? (optimazartion app)

Mads Frederik Toft shared this question 3 years ago

I would like to do a more advanced optimation app, and use drop down list to change the shapes

Let imagine if I have two lists called "inner" and "outer".

inner = {"circle", "square"}

outer = {"rectangle",triangle}

Is then possible to store the fixed shapes for circle, square and rectangle and triangle in two other lists? So then select rectangle from outerlist and circle from inner (Having turned inner and outer into drop-down menues). Then Geogebra would then do a figure which combines two shapes?

Would that be technically possible in Geogebra?

1

`Is then possible to store the fixed shapes for circle, square and rectangle and triangle in two other lists?`
Why do these shapes need to be in lists? It's probably better just to use Condition to Show Object eg

```SelectedIndex(inner)==1 && SelectedIndex(outer)==2

```
(lists work better if they contain only one type of object)

1

Thank you for your reply, I know the command circle() to draw a circle with fixed center and radius. But is there a simular command to draw a triangle, square? Besides from polygon?

1

Of course triangles and squares are polygons, but if you want to define them in whatever other way, you can define a new macro that follows a syntax that suits you more than the polygon syntax.

chris

1

You can draw regular polygons with eg

```Polygon(A,B,3)
Polygon(A,B,4)```

1

Just as update, I found a way to get Geogebra to draw the shapes using sequence command. However know next problem is to get it to toggle the different figures. Like if I choose a outer figure and I am able to select either element 1 or 2 from the list inner. I know its something to do with selectedIndex and selectedElement. But I am not sure on howto combine the two? And then shapes are stored in the list called fig.

Any thoughts ?