How to read layer names of a remote 3dm file imported/referenced in the current GH file?

May I ask is there a way to get a list of layer names of external 3dm files inside GH?

E.g. scenario: check the list of layers in a 3dm file and import geometry in selected layer(s) only.

It seems the “layer table” component in HUMAN and the “reference by layer” component in Elefront only works when the 3dm file is open in Rhino.

Try this , layers name, layers id , geometries but it is not a solution to import selected layer

layers.gh (5.9 KB)

3 Likes

The elefront component works with Worksessions

2 Likes

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.

1 Like

thanks for the solution, @anon39580149

thanks, @dharman

Learned a new trick to import multiple 3dm files as reference for the current working file.

thanks, @seltzdesign

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.