Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

ScheduleBase is a child class of ResourceObject. The ModelObject class has a resources method that returns a list of ResourceObjects directly used by instances of that class. So one way to get all model objects that use a particular schedule would be:

objects = []
model.getModelObjects.each do |obj|
  if obj.resources.include?(schedule)
    objects << obj
  end
end

That won't tell you _how_ the object uses the schedule - i.e. as an availabilitySchedule or something else, just that the object references the schedule somewhere.