We need to do an exercise and I wonder if you have come across this before:
We have two lists of points:
List A has X,Y and Z Coordinates
List B has X,Y Coordinates
Points in List B are close to points on A, let’s say in radius<500mm
The goal is to copy the Z Coordinates from List A into List B, but we need to put both lists in the same order based on their X and Y coordinates proximity.
Our first try was to generate a mesh from list A and create lines with start points from list B and the distance from 0 to the mesh will give us the Z coordinates of these points, but when I try geometry.intersect Dynamo crashes.
Can you explain your overall goal here? How do you know which Z coordinate to use? Is it based off the closest point in any direction? Closest point in the Z direction? Could you use ProjectInputOnto? How are the points being sorted? X first then Y? We need more information to give you a solid answer.
The node Geometry.Distance to calculate the distance between all the points List.MinimumItem give me the smallest distance per sublist Index of give me the index of the shortest distance within the sublist
This way I can feed the second list with the right values from the first list
Everything seems to be working fine but the output is not!!!
I think the problem is on the calculation of distances, anyone know how this node works???
I think you need to switch your Geometry.DistanceTo inputs. You’re finding the shortest distance in the bottom list then pulling the item from the first list.
The index you’re getting is the index for the closest item in the bottom list. But you’re using it to select the item in the top list. You need to flip the inputs so that you’re getting the closest item in the top list and therefore pulling the correct item from that same list.