Retreive object type from GUID?

The “Object details” component can give you the GUID and a bunch of useful attributes if you input a referenced object, but what if you already have the GUID and you want to know what kind of object it represents ?

I don’t want to reference the object, which would bloat my RAM ; I just want a string telling me what kind of RhinoObject it is.

I’m mostly interested in knowing if a GUID corresponds to a block, and what that block’s name is.

guid_2021Feb6a

for g in geo:
    print type(g)

if the guid refers to a block instance, this won’t work. Use this script instead:

detect block from guid.gh (4.9 KB)

1 Like

Excellent !
I wonder how the location of the sub-blocks is defined.
Is it a through compound between the transform of the main block, and the transform of the sub-block in his parent Baseplane ?
If so, can the transform of the sub-block be retrieved ?

Yes, each layer of “sub block” has its own transform relative to the parent. The position you see it in space is the compound transform of its transform, its parent’s transform, its parent’s parent’s transform, etc

I tried to retrieve the sub-object transform, but failed miserably.

'Gave it another thought and succeeded !