First time here? Check out the Help page!

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 4 years ago

Saif's avatar

updated 4 years ago

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
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

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
Preview: (hide)
link

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: 4 years ago

Seen: 226 times

Last updated: Jun 05 '20