Beams in Joint into Set
Scripts on this page are available here:
The example script BeamsInJointIntoSet.js shows how to use js to add all beams in a joint into a named set. You can use the same script to find all beams ending in one specific point, without a joint.

Fig. 29 The beams that has an end in the joint, marked in red, are added to a named set.