Method: OpenStudio::Workflow::Util::Model#load_idf

Defined in:
lib/openstudio/workflow/util/model.rb

#load_idf(idf_path, logger) ⇒ Object

Method to create / load an IDF file

Parameters:

  • idf_path (String)

    Full path to the IDF

  • logger (Object)

    An optional logger to use for finding the idf model

Returns:

  • (Object)

    The return from this method is a loaded IDF or a failure.



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/openstudio/workflow/util/model.rb', line 78

def load_idf(idf_path, logger)
  logger.info 'Loading IDF model'

  # Load the IDF into a workspace object and return it
  logger.info "Reading in IDF model #{idf_path}"

  idf = OpenStudio::Workspace.load(idf_path)
  raise "Failed to load IDF file #{idf_path}" if idf.empty?

  idf.get
end