First time here? Check our help page!
3

How to get Site Ground Temperature Building Surface

I am writing a measure to add SiteGroundTemperatureBuildingSurface. When reporting the initial condition I tried to use the size method to check if there is a ground temperature surface object in the model, but the size method did not work, I tried to replace it with #empty?, #is_initialized but neither worked. Which method should be used to check if there is an existing ground temperature surface object?

ground_surface = model.getSiteGroundTemperatureBuildingSurface
ground_surface.size
Saif's avatar
626
Saif
asked 2020-06-05 15:17:04 -0500, updated 2020-06-05 16:33:57 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

Here's one way you can check whether this object is in the model:

model = OpenStudio::Model::Model.new
model.getObjectsByType("OS:Site:GroundTemperature:BuildingSurface".to_IddObjectType).size # Returns 0
model.getSiteGroundTemperatureBuildingSurface # The model now has this object with default values
model.getObjectsByType("OS:Site:GroundTemperature:BuildingSurface".to_IddObjectType).size # Returns 1
shorowit's avatar
11.8k
shorowit
answered 2020-06-05 21:30:25 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments