I'm not sure what you mean by element? There are family members (object types), and there are instances of those objects — which are also considered family instances.
You can certainly loop through all existing family instances using For Each.
But if you need to iterate over all object types in a family (even if no instances of them exist on the layout), you’ll need to use JavaScript. As far as I know, that's not possible with events.