Animation Nodes: How to create splines between a particle system and an object based on distance?
It is very easy to do with Animation Nodes by using the KDTree node.
Method:

First construct the KDTree from the position of the particles. Then, use the Find Points in a Radius node to find the points/particles (shown by red color) within a radius from the Vector which is the position of the object (in this case is a Sphere).


Now, to make splines from the Sphere for each red-points/particles, we have to use the Loop node, with which we create a vector list from the sphere's position and each red-points position. Then use the Spline From Points node to create the splines from the previously created vector list, and the Curve Object Output node generates the Curve Object.



Blend File: