HB Dump gbXML crashes Rhino silently — same model translates fine in CPython

Hi @chris,

I’m hitting a reproducible hard crash with the HB Dump gbXML component: the moment I switch _dump from False to True, Rhino closes instantly. No Grasshopper error bubble, no exception, no crash report, no output file. It takes the whole process down.

This has now happened on two unrelated projects, both valid models that pass HB Validate Model without warnings.

What rules out the model itself: if I dump the exact same model to HBJSON and run the translation in the CPython interpreter shipped with Ladybug Tools, it works perfectly and in a few seconds.

from honeybee.model import Model
from honeybee_openstudio.writer import model_to_gbxml

model = Model.from_hbjson(r"C:\temp\model.hbjson")
xml = model_to_gbxml(model)
with open(r"C:\temp\model.xml", "w", encoding="utf-8") as f:
    f.write(xml)

Run with "C:\Program Files\ladybug_tools\python\python.exe", this returns a clean gbXML — 114 rooms, ~1.1 MB, correct Space count, no malformed elements. The file imports successfully into Pleiades (IZUBA).

So the geometry and the energy properties are fine. The difference appears to be the interpreter. honeybee-openstudio lists openstudio and openstudio-backporter as requirements, and in CPython it uses those native bindings — which is the path that works. In Rhino’s IronPython 2.7 that wheel can’t be used, so the translation goes through the .NET OpenStudio SDK instead, and that’s where the process dies. Being a native crash rather than a Python exception, nothing surfaces in the Grasshopper canvas.

One earlier clue, possibly related. Before the silent crash, an earlier version of the same model failed with a clean Python error:

ParseError: Invalid character in the given encoding. Line 26058, position 42.

This came from model_to_gbxml re-parsing its own output with ElementTree. The cause was non-ASCII characters in display_name and identifier values — our construction and material libraries are in French, so names like “Béton armé” or “Laine minérale” are common, and story names like “Rez-de-chaussée” go straight into the gbXML. Sanitising those to ASCII cleared the ParseError. It may be worth escaping or transliterating these at write time, since the writer currently produces a string its own parser rejects — this would affect any non-English user.

Environment

  • Windows 11, Rhino 8
  • Ladybug Tools installed via the LB Versioner, up to date
  • honeybee-openstudio 0.9.1
  • honeybee-core 1.64.79, honeybee-energy 1.126.6, honeybee-schema 2.3.0, lbt-honeybee 0.9.507
  • HB Dump gbXML component version 1.10.0

Thanks for all the work on these tools.

Hey @mchabasset ,

Thanks for letting us know but the HB Dump gbXML component was recently rewritten to no longer have a dependency on the OpenStudio SDK, which probably solves this issue. Can you run the LB Versioner and make sure that you are using version 1.10.1 of the component?

You’ll know that you’re using the new component if you see a new option to get the gbXML in IP units.

Also a note about this:

I think our new native Python gbXML exporter should be able to handle all of these characters in the names without issues. Let me know if you find otherwise.