Specify a number for geometry then read it in grasshopper

Hi all,

I am wondering if we can input a constant number to the geometry, then read the number in grasshopper.

Say each rectangle contains a constant number, then we can read this number in grasshopper, as shown in the following figure:

Thank you in advance,
-HC

The quickest way to assign a value to the geometry is by giving each geometry a name. If you want to assign more values than just a name, you can use Attribute User Text. I assigned names for all six curves and one Attribute user text for the curve ‘2’

The names and attributes can be read in GH with Elefront or possibly with a script.

I’m using Elefront and it works great for large data sets, especially also due to the option to overwrite previously baked geometry.

geometry_value_dot.gh (10.7 KB)
geometry_value_dot.3dm (34.2 KB)

1 Like

Hi @martinsiegrist

Thanks for the great idea, but what if the geometry is created from grasshopper? In other words, is it possible to assign the name for the geometry in grasshopper?

Yes of yourse that is possible.

1 Like

Thanks so much!

1 Like

Hi @martinsiegrist,

I am wondering if it is possible to reference the key and value of the geometry without baking it?

Thanks,
-HC

Yes, with a little bit of coding.

2 Likes

You don’t have to bake. In my file I assigned a key value combination in Rhino so you can see an example. You can assign keys / values with Elefront in Grasshopper

2 Likes

hi @14215567

not sure what is the problem

right click on geo, set type hint to “geometrybase”

1 Like

Hi @martinsiegrist,

Thanks. I am not sure if I really understand it - keys/ values could be assigned with Elefromt in Grasshopper but the assigned geometry will need to be baked in Rhino for the subsequent process?

At some point you will probably bake geometry but there is no point in baking just to be able to read the values again unless you have to manipulate data manually in Rhino.

1 Like

I think you are right, read the index would be fine for many cases! Thanks!