How to load Schedule:File in OpenStudio?
I read some posts and see the "schedule:file" works in OpenStudio now. Is there any example measure? I write the following codes (from another post), but it always returns "Error: File could not be found and can not be assigned to ScheduleFile objects". Is it because of the file folder, or some formats? Thanks~
The code is as follows
ext_file = OpenStudio::Model::ExternalFile::getExternalFile(model,"/Users/name/Desktop/hourly_values.csv")
if ext_file.is_initialized
ext_file = ext_file.get
else
puts "Warning, could not find file"
runner.registerError("File could not be found and can not be assigned to ScheduleFile objects")
return false
end
I would like to import pre-calculated HVAC plant load profile, from csv file into OpenStudio, I found "Load Profile Schedule" object in tab Schedule/Library (OS 1.0), but didn't find a way to to import csv file. Maybe I'm wrong when using this object, or someone can help.
I have Load profile schedule here, but I dont know how to link between them to get proper data for plant simulation, simply in the image below. They have the same name: Schedule From File, I'm not sure it's good or not
Thanks.
You can find an example of it being used here.
Thanks, got it ~
It sure sounds like your path is wrong. Try
puts File.exists?("/Users/name/Desktop/hourly_values.csv")
and see what it says.I updated and the path works, but it does not show the schedule object in the model. I will try tomorrow. Thank you for your kind answer~
Does this post answer your question?