"content" array returning arbitrary results


I’ve attached a Grasshopper definition 200929_01__ShapeDiver_DataOut_Bug.gh showing 2 data trees with identical branches (25) but different list length (N = 5 vs. N = 6). The data trees are fed each into a separate ShapeDiverDataOutput component named attributeValuesSetA and attributeValuesSetB respectively.

When retrieving the content array of the asset named attributeValuesSetA, the ShapeDiver API is returning 25 objects.
Doing the same for asset named attributeValuesSetB I get only 22 objects returned despite being the same number of branches as in the ShapeDiverDataOutput component named attributeValuesSetA.

The only difference is the number of items per branch as stated at the beginning.
This looks like a bug to me.


200929_01__ShapeDiver_DataOut_Bug.gh (9.2 KB)

Thanks for reporting this, I could reproduce the issue. Our team is investigating what the cause could be and I will get back to you once we know more. My apologies for any inconvenience.

This is not expected behavior of the data output as it doesn’t really hit any output limits. While our team is still reviewing the issue, I wanted to offer an alternative solution. You can send the data output as JSON. In the Grasshopper definition attached, the data tree was converted to array of arrays which you can then easily access:

200929_01__ShapeDiver_DataOut_Bug SD.gh (35.5 KB)

This is also more scalable and flexible solution as you can structure the JSON data in any way your application needs.

I hope this helps and if you want to learn more about working with JSON files in ShapeDiver check this blog post or the video tutorials:

1 Like

Thanks @pavol for your suggestion and the example requests!