DF Rejoin to Building change the building order

I initially thought it was the ‘ToGeoJSON’ component that wasn’t placing the features in the same order as it received them, but it turns out it’s the ‘DF Rejoin to Building’ component. When I break down the buildings by floor to apply a detailed HVAC system for each floor, the order of the floors within the same building is preserved. However, after applying the ‘DF Rejoin to Building’ object, it changes the order of the buildings that had arrived previously.

In the panels, you can see that the order changes with ‘DF Rejoin to Building’:

Hey @Batiste ,

That’s the expected behavior since the “Rejoin to Building” component uses a dictionary to group the rooms according to their parent Building and Python dictionaries are inherently unordered. Changing it to preserve the order is easy, though. It’s just a matter of replacing the native Python dictionaries with an OrderdDict. Then, the order will be preserved:

I pushed a change to the component, which I will merge shortly:

In the meantime, you can use the component in this file until I can merge the change:
rejoin_bldg_order.gh (57.9 KB)