Bake and reference geometry in C#

Hi all,

I’m having a go at baking some geometry generated in grasshopper and then automatically referencing it in the same component.
The idea is that the user can edit the generated geometry by hand (in rhino) and that the grasshopper definition will ‘listen’ to these changes and go on with the referenced geometry.
This is what I have so far:

The problem I encounter now is that the reference does not update automatically. Any idea for a strategy to tackle this?

Pass out the Guid instead of the geometry, and feed that into a geometry parameter — it will handle maintaining the reference for you. Managing this yourself is a pain!

Awesome, that indeed saves a lot of hassle, thanks!

Hi @merijndeleur , Hi @andheum ,
Thanks for this short and efficient conversation, I am learning to code into Rhino with C# and this is exactly what I wanted to acheive. Merijn would you mind sharing the final version of your node ? I see the logic but I am not fluent enough in C# to understand everything, it would be a great source to learn.
All the best

EDIT :
I just discovered I am smart enough to modify a line : " A = ref_id; " to pass out the id instead of the geometry.
I didn’t know the gemetry node could take ids. Thanks @andheum

Hi Treize,

I ditched the C# node and set up a more elaborate assembly, might be a bit much if you’re starting to learn C# as I also updated the component UI. But let me know if you would still want to have a look.

Greets