0

I wrote this code in Ghpyhton. It does not fail, but it does not work. I can group all_points by istasyon. But it doesn't work when you take the distances from the red points and write VectorReverse. I want it to move in the opposite direction when it meets the red points. Do you also know how the MoveTo command works? I would be glad if you help.

import rhinoscriptsyntax as rs

red=rs.coerce3dpoint(red_)
all_points=rs.coerce3dpoint(all_points_)
istasyon=rs.coerce3dpoint(istasyon_)

smaller=[] 
larger=[] 

for i in range(len(all_points)):
    distance = istasyon.DistanceTo(all_points) 

if distance > 10.00 :
    larger.append(i)  
elif distance < 8.00 :
    smaller.append(i)
 #print smaller
 #print larger

smaller_agents=[] 
for i in smaller:
    print i
    print all_points[i]

smaller_agents.append(all_points) 
print smaller_agents

point=[] for i in range(len(smaller_agents)):
    distance = rs.Distance(red,smaller_agents) 
    if distance < 8.00 :
        point = rs.vectorReverse([1,0,0]) 
print point
Denis Tsoi
  • 9,428
  • 8
  • 37
  • 56
  • You shouldn't post screenshots of your code, especially when you've copied and pasted the code to your question body already. Can you provide more detail on how it doesn't work, such as an actual and expected output for a given input? – Haem May 06 '20 at 10:30
  • @Haem I added the screenshot. It opens in me but you can't see it? To remove slime mold agents from certain points, I want to move in the opposite direction when you see the red dots. point = [] for i in range (len (smaller_agents)):      distance = rs.Distance (red, smaller_agents)      if distance <8.00:          point = rs.vectorReverse ([1,0,0]) print point I think there is a problem with this code. It works when the upper side tries alone. – Sena Kürkçüoğlu May 06 '20 at 12:26
  • I meant [you should not post images of code](http://idownvotedbecau.se/imageofcode). It is enoug that the code is present in your question. – Haem May 06 '20 at 12:40
  • @Haem Sorry I got it wrong. Did I explain my problem? – Sena Kürkçüoğlu May 06 '20 at 13:16

0 Answers0