Output name to panel - Elefron baking

Hi guys!

I would like to ask you, how can I take the name of any output, for example ‘cycleway’ and presrcibe it automatically to the panel? I’m baking some OSM data into my rhino file (using elefront), and I want to name the layer instantly by its data type from OSM.

Not sure whats going on with the cluster but if you use the Define Attribute component supplied by elefront you can assign Layer, Name and various attributes.

Thank for replying! So ‘cycleway’ panel is assigned to the layer name attribute, as you mentioned. The thing is that, I had to write "cycleway’ manually.

I would like to take the title of the OSM output, lets say “busway” and use some component/code? to output the title “busway” into the panel - automatically after connecting wires. Then baked pline will be on the proper layer instantly, and I would safe some time not writing it in the panel by myself.

Using python component with x set to tree access:

import rhinoscriptsyntax as rs
import Grasshopper as gh

ghdoc = ghenv.Component.OnPingDocument()
val = ghenv.Component.Params.Input[0].Sources[0]
print val.Name

I don’t know if you want the Name or NickName.

1 Like

Oh, thats perfect! Thank you so much!

Is there similar way to get the name of the component?
Then I can join strings and name the layer as ‘Highway_cycleway’

I don’t know how to do it in python. Can’t quite find the right parameter in the documentation for that.

You can use Metahopper

Get Connected Objects
Component Info

1 Like