Layer Full Path from Panel

Right clicking on a layer from the panel should enable me to copy the full path of the layer. Something like copying a link for sharing.
This seems crucial when working with the geometry pipeline.

1 Like

Hi @ANDhitecture,

How would this help your workflow?

– Dale

I don’t use full paths for my layer systems. It’s all in a Excel table and it gets imported from there, and nearly organized in trees.
So, when I need to import geometry in Grasshopper via Geometry pipeline, I always need to write the full layer path, for the geometry I like to import.

In this example, I’m showing two Layers with the same name, in a different category.

If I could copy the full path of the layer, then I could paste it inside the module.

Rhino_PfxEnwSCgd

You can mark and copy paste the full alyer name by selecting an object on that layer and then click ‘Details’ at the bottom of the properties tab. Instead of clicking ‘Details’ you can also type What into the command line.

Or forget about the Geometry Pipeline. Copy pasting is not ideal anyways. What if you rename the layer for whatever reason? You’d have to update the pasted name in the Geometry Pipeline manually…

Instead you could use EleFront in Grasshopper Rhino 7 and 8 WIP or Grasshopper Rhino components in Rhino 8 WIP. Or use a python script.

I understand all that. And I’m familiar with all these principles, and I have [I like to think that I have] a elaborate system for automating processes where I’m not dependent on these manual principles.

But when starting a project I use a set layer system that acts as a primitive database for lines and points when concepting from which I generate the basic architectural elements needed at an early stage.
So for quick sketches it would be nice to have a more direct way to copy the path to your object.

1 Like

Hi @ANDhitecture,

Since the Layers panel does not have this feature (right-click to copy layer path to the clipboard), you might want to use a script instead.

import Rhino
import System
import scriptcontext

def CopyLayerPathToClipboard():
    current = scriptcontext.doc.Layers.CurrentLayerIndex
    result = Rhino.UI.Dialogs.ShowSelectLayerDialog(current, "Copy Layer Path", False, False, False)
    if result[0] == True:
        layer = scriptcontext.doc.Layers[result[1]]
        if layer:
            System.Windows.Forms.Clipboard.SetText(layer.FullPath)

if __name__ == "__main__":
    CopyLayerPathToClipboard()

CopyLayerPathToClipboard.py (473 Bytes)

– Dale

https://mcneel.myjetbrains.com/youtrack/issue/RH-77013

1 Like

If you want to get the full path to a Layer using Grasshopper, then there are a couple of options. First, I’d recommend using the Query Layers component to retrieve a list of all of the layers found in your model. The output of this component is a list of GH_ModelLayers which contains all the attributes of a given layer. What we need is just the text version of the layer full path. To do this you can either use the Content Information or Content Details components. The Content Information component has two outputs (Parent and Name) which correspond to the parent layers and the final child layer names. You could choose to concatenate those together if you needed all of the parts, or use them separately depending on your need. Alternatively, the Content Details has a Path output which contains the full path of each layer. Does this do what you’re looking for?

1 Like

Very cool. This is v8. Can’t wait to incorporate these long-awaited protocols in my pipeline.

As a matter of fact I’m doing the reverse to import and bake layers.

But still no, I just wanted to have an easy, very low-tech, very direct way to be able to just copy the full path of the layer.
A right-click or something similar should do.
I feel like the layer path should be part of the menu with all other layer stuff.

I’m imagining it like a text panel at the top of the dropdown, where you can copy by clicking on the layer name or have another option to rename it.

Or as I can see now that the layer panel has a search bar [THANK YOU!], maybe when you click on a layer it can fill the search bar with the full layer name?! Maybe… Something…

An alternative to what I showed earlier would be to use the Model Layer component to select a specific layer from your layer list. Then extract the Full Path name using the Content Details component as I suggested before. Finally, use the Query Model Objects component (instead of the geometry pipeline) to get only the geometry found on that specific layer. The Query Model Objects component has a Layer name filter input which will pre-filter all of the objects on the Layer name and return only those objects. Does this work for you?

LayerFullPath.3dm (44.8 KB)
GetLayerFullPath.gh (8.6 KB)

This works beautifully. Thank you so much.
It’s not what I meant with starting this thread, but it’s a very decent workaround this problem.

result = Rhino.UI.Dialogs.ShowSelectLayerDialog

Didn’t know I could do this. More of a C# guy.

I usually go about it like this [Human+LB>

Is this again from Rv8?
Why are these components not available in R7? I see that the Gh version is the same.

Yes, these are Rhino 8 components. Rhino 8 features quite a few new components that aren’t available in Rhino 7.

1 Like