File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1314,14 +1314,25 @@ def model_to_gbxml(
1314
1314
assert isinstance (model , Model ), \
1315
1315
'Expected Honeybee Model for model_to_gbxml. Got {}.' .format (type (model ))
1316
1316
1317
+ # remove degenerate geometry within native DesignBuilder tolerance of 0.02 meters
1318
+ original_model = model
1319
+ model = model .duplicate () # duplicate to avoid mutating the input
1320
+ if model .units != 'Meters' :
1321
+ model .convert_to_units ('Meters' )
1322
+ try :
1323
+ model .remove_degenerate_geometry (0.02 )
1324
+ except ValueError :
1325
+ error = 'Failed to remove degenerate Rooms.\n Your Model units system is: {}. ' \
1326
+ 'Is this correct?' .format (original_model .units )
1327
+ raise ValueError (error )
1328
+
1317
1329
# remove any detailed HVAC or AFN as this will only slow the translation down
1318
1330
v_control = model .properties .energy .ventilation_simulation_control
1319
1331
det_hvac_count = 0
1320
1332
for hvac in model .properties .energy .hvacs :
1321
1333
if hvac is not None and not isinstance (hvac , IdealAirSystem ):
1322
1334
det_hvac_count += 1
1323
1335
if v_control .vent_control_type != 'SingleZone' or det_hvac_count != 0 :
1324
- model = model .duplicate () # duplicate to avoid mutating the input
1325
1336
for room in model .rooms :
1326
1337
room .properties .energy .assign_ideal_air_equivalent ()
1327
1338
v_control .vent_control_type = 'SingleZone'
You can’t perform that action at this time.
0 commit comments