Thierryj Posted November 17, 2018 Share Posted November 17, 2018 (edited) hey guys! I am new to arrays so I am a bit confused... I am doing a nearpoint function between some points which will return to me point numbers that I am storing as an attribute. Here, each point will have an attribute called @nearest with the nearest point number to them stored inside. I am trying to take all of these nearest point numbers and store them into an array however I am failing. I am trying to make a for loop where i is under the point number however my array is repeating itself for the same point (point zero will get [57,57,57,57,57,57,57,57,...... (until the number of points there is)] etc... Attached is a screenshot of my script. Any suggestions? Thanks!! Edited November 17, 2018 by Thierryj Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted November 17, 2018 Share Posted November 17, 2018 Hi, try to use nearpoints instead of nearpoint. nearpoints is returning a list of the closests points in the geometry sorted by distant. nearpoints.hipnc Quote Link to comment Share on other sites More sharing options...
Atom Posted November 17, 2018 Share Posted November 17, 2018 Also, you don't want to loop over every point while running over points. That will run very slow. When you run over points you are essentially inside a loop already. To manually loop over points you want to change your Run Over to Detail mode. Then the wrangle will only run once, but on a single thread. When running over points you get multi-thread acceleration for free. Quote Link to comment Share on other sites More sharing options...
Thierryj Posted November 18, 2018 Author Share Posted November 18, 2018 Thanks for the replies guys! I will try this method however I am not sure if this is what I want. What I am after is to get the list of all these points into 1 array for all the points. So point 1 will have the nearest point of all the other points into its array. I will try your method to see what it does. Thanks again!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.