Print at Dec 17, 2025, 9:14:24 AM

Posted by Daniels118 at Jun 20, 2022, 7:45:26 AM
Re: Add "o" to OBJWriter output
Is it possible to check/get the parent groups from a HomePieceOfFurniture?

I'm quite sure you can't get the parent directly. However you can get the child from the parent, so you can iterate over all groups to build a child->parent map, and use it later to query the parent from the child.
Keep in mind that groups can be nested, so if you want to recreate the hierarchy you have to prepend the parent name in a loop until the object has no more ancestors.
Another approach could be to retrieve the objects using Home.getSelectableViewableItems(), which returns all the non-grouped objects + the groups, then you can itearate over the items and if you find a group dive into it using a recursive method.