openstudiocore/src/openstudio_app/Resources/populate_loads.rb
# Helper to load a model in one line
Helper to load a model in one line
Helper to load a model in one line
def osload(path)
  translator = OpenStudio::OSVersion::VersionTranslator.new
  ospath = OpenStudio::Path.new(path)
  model = translator.loadModel(ospath)
  if model.empty?
      raise "Path '#{path}' is not a valid path to an OpenStudio Model"
  else
      model = model.get
  end
  return model
end
def osload ( path ) translator = OpenStudio :: OSVersion :: VersionTranslator . new ospath = OpenStudio :: Path . new ( path ) model = translator . loadModel ( ospath ) if model . empty? raise "Path '#{path}' is not a valid path to an OpenStudio Model" else model = model . get end return model end
Helper to load a model in one line
Helper to load a model in one line
path
<not_specific>