Pick chain of elements

For the “other way” I suggest to use the Group Curves node from Archi lab. Here is an example: Select connected elements