Or you can use the Human plugin. It has some excellent components for just that. I think you are looking for “Layer List”
Edit (again): nope, turns out Human was correct. Just use the “Read 3dm” component and you get all the objects and layers. Then you can just filter the layers to get the objects you want.
It seems that the Layer Table component in Human is unable to read layer names of a remote 3dm file imported into the current 3dm file through the GH native import 3dm component. However, it works if the remote 3dm files are “attached” to the current 3dm file using the worksessions method as suggested by @dharman.
Yes, true, layer list is for the open file. You need to use the “Read 3dm” component from Human. It has an output for all the layers. But it also loads all the geometry from a file, which might not be what you want.
I haven’t tried the worksessions approach, but will look into it.
You could use the Human component twice; once to read all layers and another time to use the layer names as input for the layer filter in the second component to get the objects from a particular layer.