Is there a way to find all objects that use a particular schedule?
I am creating an openstudio power outage measure using openstudio CLI (command line interface) that modifies all the schedules in the entire model.
First, I wrote a code to modify the schedule file. Then, I created a loop to identify each schedule and translate them to a ruleset with three parts: pre-outage, outage, post-outage.
I am stuck on the step where I need to pull out all the model objects that use the original schedule, so I can change schedule from the original one to the new outage ruleset.
in Ruby:
model.getSchedules.each do |sch|
< a lot of code here >
model.getModelObjects.each do |obj|
# Find obj whose schedule == sch (STUCK HERE)
end
end
Thanks