Grasshopper - Cast Rhino.DocObjects.ObjectAttributes to ModelContent

Hello,

I would like to be able to cast object attributes (Rhino.DocObjects.ObjectAttributes) to the new ModelContent -format in Rhino 8’s Grasshopper.

I can cast an object Reference (GUID) in Grasshopper directly by plugging it into the ModelObject’s “Object” parameter, but I can’t find a way to cast the data type Rhino.DocObjects.ObjectAttributes, which I have in isolation in Grasshopper, into ModelObjects.

I want this because I am trying to migrate my Grasshopper definitions to Rhino 8 bit by bit and up until now have used custom baking methods, Human and Elefront, all of which involve separating geometry and ObjectAttributes a lot of the time.
I’d like it if I could just cast some of those final, very-down-stream and separated ObjectAttributes (or eleFront Attributes) into ModelObject -style, so I could then reattach geometry, bake, and call it a day.

I’m more versed in Python than c# and I’ve tried to sniff out whether there’s a constructor or method in Grasshopper.Rhinoceros.Model.ModelObject.[…] to ‘inherit’ attributes or just cast them, but I haven’t had any success.

Is there a way to do this? If not, could I have it put on a feature wishlist, please?

Thanks in advance
-Pekka

Hi @pekka.riihonen,

We have added two new constructors to ModelObject to enable this.
It will be available on next RC.

1 Like

Hiya Kike!

I think I noticed this as just a few days ago I started taking new swings at this and made some progress.
Thank you!

Looking forward to the next release(s)!