Import gbXML- Inconsistent Zone Order

Hi,

I’m working with my supervisor, @MichaelDonn, on calibrating an energy model using a gbXML file (Fig.1). We’ve encountered an issue where the zones get reordered whenever we restart the program (Rhino & Grasshopper) or switch between different devices using this script (Fig.2).

Fig.1:

Fig.2:

As a result, we often need to restart the software 3 to 5 times to get all the rooms in the test unit to return to their correct locations or to be reordered correctly (Fig.3).

Has @chris or anyone else experienced this issue before? Any ideas or suggestions on how to resolve it would be greatly appreciated.

Thanks in advance!

Hirda

I would try to use the HB_dump_objects and HB_load_objects.

The Dump to save the model after import the gbxml as json file. And the load to load it from there each time you need the model and not using the gbxml which is giving you trouble.
Hope this helps.
-A.

Hi @hirda_khalid,

Interesting. I guess in my opinion: I would assume consistent order of rooms is not guaranteed, especially when going between formats like that.

I think you are much better off doing as you do in ‘Fig-2’ and using some form of ‘key’ (in your case, room name) to sort/filter/find which room is which.

Perhaps I don’t follow, but it seems that your ‘Fig-2’ is giving you the output you desired, no? Is there a problem with doing it that way?

best
@edpmay

Kia ora @edpmay

As far as we can tell from examining the text of the gbxml file, there is no apartment label @hirda_khalid could use as tge pattern.

The notion that the room objects which are in a particular order in the original text of the gbxml source are read into the hb model is disconcerting.

M

Hi @MichaelDonn ,

Hmm - the gbXML should keep the Room names for the Zone? In this example it appears to preserve the Room names for me?

@hirda_khalid Perhaps if you provided an example demonstrating the behavior in question that would help?

best,
@edpmay

Example File:

example.gh (44.4 KB)

Kia ora Ed (@edpmay) I think the issue is how the Design Builder file was built from which the gbxml was created.

It seems the originator of the gbxml was just focused on the input of all the rooms in a multi apartment building model.

Unfortunately, the conditions of confidentiality under which we have access to the file preclude sharing. We hoped some other folks might have encountered the issue. Even editing the text of the xml does not reveal a hint at some level of organization by apartment identifier.

What is surprising is each time the xml is read the order of rooms is different. We could of course manually do this once and save that model, but it seemed worth discovering what we are missing about the read order.

M

This is probably more of a question for the OpenStudio team on unmenthours than for me. I know all of our Ladybug Tools Python code preserves the order of Rooms but the OpenStudio gbXML translators that we use to import a gbXML file into an OSM that we can translate to a Honeybee model might not be preserving order. I know that OpenStudio SDK has some “unordered list” data structures that govern some things that go on in the background. So they might be the cause of the order changing each time.

You could find out for sure by importing the gbXML into the OpenStudio Application and seeing if the order of the Zones or Spaces changes each time. If it does, then it’s a question for the OpenStudio team.

Or you could just do something like sorting the Rooms alphabetically as soon as you import them from gbXML to give them a consistent order. Similar to what you were suggesting, @edpmay .

1 Like

Kia ora tatou

Thanks @chris, @edpmay and @AbrahamYezioro.

It has (finally) occurred to me that the solution - as hinted by @Chris and originally suggested by @AbrahamYezioro is two separate scripts.

  1. import the gbXML file and manually visualise the 3 rooms x 24 apartments. Then create models with Apartment names that are immediately HB Dumped.
  2. Then, these files have all the attributes we want and we can set up to run multiple apartment or single apartment studies from a couple of hard-coded drop-down lists with the names we have assigned. (Royal “we” of course)

Thanks from @hirda_khalid and myself …

1 Like

Thank you @MichaelDonn, for clearly explaining everything.

And many thanks to @AbrahamYezioro @edpmay and @chris for your helpful recommendations. As my Supervisor explained, we tried all the suggested options yesterday and it finally worked!

I truly appreciate the support from all of you.

Hirda