Trying to get Geometry.DistanceTo Node to read the closest instance

The full script intention is to read ceiling geometry in a linked model and move generic models up to the ceiling surfaces it finds directly above it.
I’ve run into an issue where the Geometry.DistanceTo node is reading ceilings too far away rather than instances directly above the generic models.

Is there a way to make the Geometry.DistanceTo node only read the Z-axis directly above a geometry? Set Elevation.dyn (89.9 KB)

  1. You can pull out the point.z for the geometry and make the comparison that way.
  2. You can draw a line between geometry instead and use the line data to extract the z value.
  3. You can use Raybounce nodes. Generally speaking, they take a point and a vector, shoot a ray from the point in the direction of the vector, and report back what the ray hits and at what point in space. With a 3D view containing your generic models + ceilings, this would probably do the trick.

Some reference links on raybouncing:

1 Like

Thanks! I got it working using the Raybounce node and it was a lot simpler than what I was originally doing