Help on managing lists


#1

Hello,

 

New user to Dynamo here. I’ve played around with Grasshopper a bit before but have forgotten a lot of it…

 

Anyways my questions if anyone can answer is how to control the rights side of the data list? I have numbers ranging from 0 to 7.5 and I would like to only take any number between 0 to 4.

 

Ultimately I am just trying to make an attractor point that doesn’t take the whole geometry into account but rather just a section near the point itself.

 

Untitled-1


#2

Unbenanntes Bild


#3

Thank you for the solution, probably a dumb question but how do I now get that index [0] list only? can’t seem to find an answer anywhere.


#4

the list index [0] is representing the elements IN the range index [1] the elements OUT your range.

so in your case connect to IN

the option with in and out is very convenient. so you may place square columns for all elements in range, and circular columns for all other elements.

 


#5

Hi Peter,

Ok that makes sense now. It seems like this whole process was maybe pointless though I realized…I am ultimately trying to make an attractor point system that only attracts X distance away from it and leaves any points beyond X alone. Do you or anyone else have any advice on how best to do this?


#6

I think what Peter suggested is your best approach. You could use the “Geometry.DistanceTo” and then compare the result to your X value. I’d just like to add that if you need to filter for more than one condition in the future, you could use the “&&” or “And” nodes:

2014-10-02_095502