Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

How to get Site Ground Temperature Building Surface

asked 2020-06-05 15:17:04 -0600

Saif's avatar

updated 2020-06-05 16:33:57 -0600

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
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-06-05 21:30:25 -0600

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
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2020-06-05 15:17:04 -0600

Seen: 192 times

Last updated: Jun 05 '20