Getting GUID of rhinoGeometry from inside c# component - without using the ID component

unhandled

#1

Is there a way to get the GUID of a rhinoGeometry which is referenced into grasshopper from inside a c# component.

I get it to work with fine with the ID component, feeding the GUID into the c# component alongside the geometry.

Since my component is sorting and resorting the input geometry, it would be fine to access the GUID at any stage, without sorting the GUID alongside and passing it on to other custom components.
I would like to access all data from the GUID, like UserText and ObjectAttributes like Layers etc.

Thanx

Udo


(David Rutten) #2

No. As soon as the Grasshopper curve object (which knows about the reference ID) goes into the C# component it is stripped bare to just the Rhino curve data.

Possibly you could investigate the actual data that was the source of the C# input by looking at the sources of the relevant input and paging through their VolatileData, but this would both be difficult and error-prone.


#3

Hi David,

thanks for you reply. So as far as I understand it, once you alter the inputGeometry by passing it further through custom components or subclasses, you loose the information.

Thx, then I will see how I store the information otherwise.

Udo


(David Rutten) #4

VB and C# components reduce the data to their RhinoCommon and framework forms if possible. GH_Number becomes double. GH_Point becomes Point3d. etc.

You will also lose certain information if you convert to another type of data, such as curve \rightarrow line. Lines cannot be referenced so there is no way for reference ids to persist.


(Andrew Heumann) #5

You can get around this by setting your c# script input to type Guid - it will auto convert just like any param. Then you can grab the raw geometry yourself and anything else you need:


#6

Thx Andrew,

that shortens one input, the GUID info I have to sort in parallel nevertheless.
But still thanx for that clue, that is very helpful in general.

Udo


(Andrew Heumann) #7

What do you mean sort in parallel?


#8

within this component there is some sorting and labelling of the curves so I either have to sort the GUID alongside or the respective attribute or multiple attributes.