Skip to content

Commit

Permalink
Made Boundaries on THERM Components Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Mar 15, 2016
1 parent 0394983 commit a8e7255
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Honeybee_Write THERM File.py
Expand Up @@ -27,7 +27,7 @@
Args:
_polygons: A list of thermPolygons from one or more "Honeybee_Create Therm Polygons" components.
_boundaries: A list of thermBoundaries from one or more "Honeybee_Create Therm Boundaries" components.
boundaries_: A list of thermBoundaries from one or more "Honeybee_Create Therm Boundaries" components.
meshLevel_: An optional integer to set the mesh level of the resulting exported file. The default is set to a coarse value of 6 but it may be necessary to increase this if THERM tells you to 'increase the quad tree mesh parameter in the file'.
workingDir_: An optional working directory to a folder on your system, into which you would like to write the THERM XML and results. The default will write these files in into your Ladybug default folder. NOTE THAT DIRECTORIES INPUT HERE SHOULD NOT HAVE ANY SPACES OR UNDERSCORES IN THE FILE PATH.
fileName_: An optional text string which will be used to name your THERM XML. Change this to aviod over-writing results of previous runs of this component.
Expand All @@ -52,7 +52,7 @@

ghenv.Component.Name = 'Honeybee_Write THERM File'
ghenv.Component.NickName = 'writeTHERM'
ghenv.Component.Message = 'VER 0.0.59\nFEB_15_2016'
ghenv.Component.Message = 'VER 0.0.59\nMAR_14_2016'
ghenv.Component.IconDisplayMode = ghenv.Component.IconDisplayMode.application
ghenv.Component.Category = "Honeybee"
ghenv.Component.SubCategory = "11 | THERM"
Expand Down Expand Up @@ -98,9 +98,9 @@ def checkTheInputs():
hb_hive = sc.sticky["honeybee_Hive"]()
try:
thermPolygons = hb_hive.callFromHoneybeeHive(_polygons)
thermBCs = hb_hive.callFromHoneybeeHive(_boundaries)
thermBCs = hb_hive.callFromHoneybeeHive(boundaries_)
except:
warning = "Failed to call _polygons and _boundaries from the HB Hive. \n Make sure that connected geometry to _polygons is from the 'Create Therm Polygons' component \n and that geometry to _boundaries is from the 'Create Therm Boundaries' component."
warning = "Failed to call _polygons and boundaries_ from the HB Hive. \n Make sure that connected geometry to _polygons is from the 'Create Therm Polygons' component \n and that geometry to boundaries_ is from the 'Create Therm Boundaries' component."
print warning
ghenv.Component.AddRuntimeMessage(w, warning)
return -1
Expand All @@ -126,7 +126,7 @@ def checkTheInputs():
except:
checkData = False
if checkData == False:
warning = "Geometry connected to _boundaries are not valid thermBoundaries from the 'Create Therm Bounrdaies' component."
warning = "Geometry connected to boundaries_ are not valid thermBoundaries from the 'Create Therm Bounrdaies' component."
print warning
ghenv.Component.AddRuntimeMessage(w, warning)
return -1
Expand Down Expand Up @@ -474,7 +474,7 @@ def main(workingDir, xmlFileName, thermPolygons, thermBCs, basePlane, allBoundar
boundGeoProp['Emissivity'] = thermMatLib[polygon.material]['Emissivity']
matEmiss = thermMatLib[polygon.material]['Emissivity']

#Check if the boundary aligns with any of the connected _boundaries.
#Check if the boundary aligns with any of the connected boundaries_.
for boundary in thermBCs:
boundGeo = boundary.geometry
closestEndPt = rc.Geometry.PolylineCurve.ClosestPoint(boundGeo, segEndPt, sc.doc.ModelAbsoluteTolerance*2)[0]
Expand Down Expand Up @@ -608,7 +608,7 @@ def main(workingDir, xmlFileName, thermPolygons, thermBCs, basePlane, allBoundar

#First, check if the user has specified any boundary conditions for the air cavity.
if allNotMatched:
#Check if the boundary aligns with any of the connected _boundaries.
#Check if the boundary aligns with any of the connected boundaries_.
for boundary in thermBCs:
boundGeo = boundary.geometry
#print rc.Geometry.PolylineCurve.ClosestPoint(boundGeo, segEndPt, sc.doc.ModelAbsoluteTolerance*2)[0]
Expand Down Expand Up @@ -739,7 +739,7 @@ def main(workingDir, xmlFileName, thermPolygons, thermBCs, basePlane, allBoundar
newPolygons.append(allPolygon[pCount])
allPolygon = newPolygons

#Check to be sure that all _boundaries have been matched with _polygons and, if not, give a warning that the BC is being left out.
#Check to be sure that all boundaries_ have been matched with _polygons and, if not, give a warning that the BC is being left out.
if len(thermBCs) != len(matchedBoundaries):
allBndNames = []
for b in thermBCs: allBndNames.append(b.name)
Expand Down
Binary file modified userObjects/Honeybee_Write THERM File.ghuser
Binary file not shown.

0 comments on commit a8e7255

Please sign in to comment.