It doesn’t seem possible to retrieve user properties from geometry inside a block.
Is it because you are passing data through the text panel? Not a good idea!
Hmmm… In the bottom example, you are connecting a brep to the ‘A’ input, while in the top, you are passing it attributes (‘att’) instead of a brep (‘geo’)?
This components accepts either geometry or attributes.
In fact, the geometry output by the “BlockExplodeRecursively” component seems to be devoid of attributes…
I tried to assign the “user text” key and value directly to the block instance, but it’s the same problem : the “udk” and “udv” outputs have nothing to say, unless I plug the "Object attributes " directly to the “Dynamic Geometry Pipeline” :
The problem is that this leaves with a very limited use of User data from blocks in Grasshopper…
In fact, we only use nested blocks, and the most important attributes are on low-level blocks.
I think I found a workaround : Elefront seems to retain the properties from the geometry inside the blocks and the “GetUserAttributes” component manages to output the Keys and values.
A couple notes:
- The geometry output by any component will not work with the object attributes component - this can accept either an Object Attributes object itself, a Rhino.DocObjects.X type (like a raw block from Dynamic Pipeline) or a referenced rhino object - (it will say “Referenced Brep”, for instance). Raw geometry in Grasshopper contains no attributes. This is why the Block explode components also pass out attributes (the “att” parameter).
- You appear to be correct that user data keys + values are somehow stripped from the objects in the “Explode” process; I will investigate this.
This turns out to be a Rhino bug - the InstanceObject.Explode() method strips user strings from attributes objects. By querying the instance definition instead of relying on explode I can fix this in my own code.
Thanks Andrew !
reported the bug here: InstanceObject.Explode strips user text from object attributes
here’s a hotfix for Human in rhino 6:
Human.gha (416 KB)