Define Block from GUID?

Is there a way that I can define a block in Grasshopper without referencing the geometry, but only giving it a GUID of the geometry I want to turn into a block?

Basically like Human’s Define Block, but instead of a geometry input it has a GUID input.

I need this since referencing geometry in GH will make it lose all materials and other references. I am doing this for assets coming from Vray Cosmos, which do have materials linked to them, but in GH their materials just show “Null”. Doing it via GUID works fine though. I am using OpenNest’s Transfrom GUID and that works great for keeping all the materials intact.

Thanks for any hints.

I don’t think there’s a clean & scriptless way to do it right now… (you may reference the object’s attributes and use them again as input, but I don’t if it would work) My own block management plugin is going to support such a practice. For now here’s a C# workaround:

20210316_createblock.gh (9.3 KB)

1 Like

Works perfectly, thanks so much!

Now I can reference the Vray Cosmos Mesh, get the GUID from it and create a block of it all in Grasshopper without losing any of the connection to the materials and Vray Cosmos in General.

Then I can use Human’s place block by name and place the instances of the blocks in Grasshopper.

While we are on the topic of GUID. Would you know how to transform a GUID, but without copying it? There is the Transform GUID component from Open Nest that works great for one part of what I am doing, but I would like to be able to transform all the placed objects again, but not duplicate them in the process, but actually just transform the object connected to the GUID.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_Tables_ObjectTable_Transform_2.htm

Sadly afaik there’s no in-place transform (also a reason why many usual practice hide GUID from the end user). The original object is just deleted.

Hm, yeah that is weird. Mainly because that’s not what happens in Rhino, but only through scripts. If you transform an object in Rhino, it keeps its GUID. Maybe something to do with history and such?

Can someone from McNeel explain why you can’t do that through script or from Grasshopper. It would in some cases negate having to reference and then bake something in Grasshopper and have to transfer all the parameters again, which is not always possible, if say, all I want to do is apply some transforms. Maybe I need to start a new thread on that, as this one already has a solution to the original question…