Execute command with list elements

Rumburak shared this question 1 year ago
Answered

I have list listMove with two points name stored :

listMove={"N", "F"}


Now I want to move point N to point F

Execute({"SetValue[%1, (x(%2),y(%2),z(%2))]"},Element(listMove,1),Element(listMove,2)) but error occurs...

Best Answer
photo

Hi,


an other way :

create text command in algebra :

cmd = "SetValue[" + (Element(listMove, 1)) + "," + (Element(listMove, 2)) + "]"

then, button script :

Execute[{cmd}]

...

Comments (5)

photo
1

listMove={"N", "F"} is not a two points list. it is a two text list with the names of points

you mean N,F points

then you can do setvalue(N,F)

if you had made listMove={N,F} then the list is updated

photo
1

Next is the scenario :

click on point N -> return point name "N" ->put this value into listMove[1]

click on point F -> return point name "F" ->put this value into listMove[2]

and I want to use command SetValue[N,F]

I do not know how to get with click the name of the point N instead of "N"

even with javascript if with GG command is not possible.

photo
2

Hi,


an other way :

create text command in algebra :

cmd = "SetValue[" + (Element(listMove, 1)) + "," + (Element(listMove, 2)) + "]"

then, button script :

Execute[{cmd}]

...

photo
2

Hi,


with my way :

possibilities to choice point : see attachment...

photo
1

Merci beaucoup Patrick. Tu as sauvé ma journée :)

© 2019 International GeoGebra Institute