Grasshopper

algorithmic modeling for Rhino

Hi everyone!

I'm haveing some trouble with the test of the existance of some points in a list of other points.

The comparison in python works, but it checks the existance of a value in a list, and does not work for points.


ListA = [0,1,2,3,4,5,6]

ListB = [1,2]
Res = []

for i in range(len(ListA)):

    if (ListA[i] in ListB) is True:

          Res.append(None)

   else:

          Res.append(ListA[i])

The result is 

Res = [0,None,None,3,4,5,6]

This is ok. But when i apply the same method to list with points, it doesn't work.
Do you know another way for this?

Thanks,
Edo

Views: 298

Replies to This Discussion

Got it, i've considered coordinates separetely, in three consecutive if statements.
Thanks.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service