Select objects

Is the issue in creating the definition to get the collisions or the actual selection in Rhino?