BakeDataInObject returns empty Guids for Group params

I’m banging my head against the wall here! I am simply trying to bake geometry into the correct layers.

First thing I tried was setting the current layer before baking ==> mixups all around.

Then I tried to grab the baked objects and modify their attributes ==>
error: NoneType has no attribute ‘LayerIndex’ (wat?? baked object has no attributes??)

I finally realized that although you can bake objects in a group param, and they are added to the rhino doc in groups as expected, the BakeDataInObject returns a list of empty guids.

I guess I’ll have to give up on the grouping. I cannot see a practical solution here (I don’t want to do something like this to manually iterate through an unknown number of groups).

The python script is a fairly complex Eto form, and for some reason rhinoscriptsyntax and scriptcontext loose track of the rhino document “at some point”, forcing me to fall back to rhinocommon (or copy-paste parts of their source into my script). At least that worked!

At this time I can’t develop a proper rhino plugin at work, I have to stick to GH, python (and Rh7). But this is a cautionary tale. Python is a terrible terrible language, the code of rhinoscriptsyntax (I had to read a lot of it) is pretty bad, and trying to glue Eto and Grasshopper together will send you into a bottomless pit of anger and/or dispair.

So at least I figured I could write this post so that this bug would be documented somewhere. GH_RhinoScriptInterface.BakeDataInObject return empty Guids for Group params.

PS: AI won’t help you lol
PPS: No offense to whoever wrote rhinoscriptsyntax. Python sucks, period.