hello everyone, I am a beginner in using Grasshopper in Rhino 6. I am interested in making a simulation of human movement using Rhino 6 with the help of python scripts in Grashopper. I have studied several function blocks in Grasshopper specifically the python script block in the past month. I understand a little about the characteristics of python programming in Grasshopper. Btw I have experience using python in Raspberry Pi (so I also have a basic understanding of Python programming). at this time I have been able to move the object (human simulation) to a point (destination). but because python cannot reverse the output into input again (feedback) I have difficulty updating the value of the object’s position, which I want the object to stop when it reaches the destination and then continue to the new destination.
this is the result of my simple design:
then this is a simple simulation that I want to make:
then this is an image when the object is running:
anyway this my grasshopper program :
3_1_2020.gh (27.8 KB)
(free to use or to develop)
I have several obstacles in several ways such as:
a way to manipulate feedback on python script blocks
I don’t know how but I can’t use the while command in the program script … every time I use the while command and then add the time.sleep function, the program always crashes. So I manipulated it using the for command from the timing source (counter).
Related to logic … I plan to make it so that when the switch button is pressed the object will stop running … and will run again when the switch button is off … but what happens is when the switch button is pressed, the object returns to the initial point (should stop) then when the switch button is turned off the object instead runs more than the point it should stop. My guess is when the switch button is turned on … the program to run the object still runs (does not stop) but is not displayed, but when the switch button is turned off the object is displayed again.
I would like to ask for help to all of you related to my problem points above. if there are suggestions for improving the design of my program, I would appreciate it.
if there are other possibilities outside the program that I made, please let me know.
Thank you to all of you