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

Revision history [back]

ScheduleTypeLimits is the object, it's already plural. If you need to get all of them, you need to append another s:

# Return an Array
model.getScheduleTypeLimitss

You could try getting them directly by name:

# Returns an optional, try `.empty?`then `.get`
model.getScheduleTypeLimitsByName("Fractional")

Of course you can use the array of ScheduleTypeLimits to filter on those that are Continuous only:

arr_continuous = []
model.getScheduleTypeLimitss.each do |s|
  next if s.numericType.empty?
  next if s.numericType.get != "Continuous"
  arr_continuous << s
end

Or the one-liner equivalent for fun:

model.getScheduleTypeLimitss.select{|s| (s.numericType.is_initialized) & (s.numericType.get == "Continuous")}

ScheduleTypeLimits is the object, it's already plural. If you need to get all of them, you need to append another s:

# Return an Array
model.getScheduleTypeLimitss

You could try getting them directly by name:

# Returns an optional, try `.empty?`then `.get`
model.getScheduleTypeLimitsByName("Fractional")

Of course you can use the array of ScheduleTypeLimits to filter on those that are Continuous only:

arr_continuous = []
model.getScheduleTypeLimitss.each do |s|
  next if s.numericType.empty?
  next if s.numericType.get != "Continuous"
  arr_continuous << s
end

Or the one-liner equivalent for fun:

model.getScheduleTypeLimitss.select{|s| (s.numericType.is_initialized) & (s.numericType.get == "Continuous")}

Just FYI, these two methods shall prove useful to return the possible values for numericType and unitType:

OpenStudio::Model::ScheduleTypeLimits::numericTypeValues
OpenStudio::Model::ScheduleTypeLimits::unitTypeValues

ScheduleTypeLimits is the object, it's already plural. If you need to get all of them, you need to append another s:

# Return an Array
model.getScheduleTypeLimitss

You could try getting them directly by name:

# Returns an optional, try `.empty?`then `.get`
model.getScheduleTypeLimitsByName("Fractional")

Of course you can use the array of ScheduleTypeLimits to filter on those that are Continuous only:

arr_continuous = []
model.getScheduleTypeLimitss.each do |s|
  next if s.numericType.empty?
  next if s.numericType.get != "Continuous"
  arr_continuous << s
end

Or the one-liner equivalent for fun:

model.getScheduleTypeLimitss.select{|s| (s.numericType.is_initialized) & (s.numericType.get == "Continuous")}

Just FYI, these two methods shall prove useful to return the possible values for numericType and unitType:

OpenStudio::Model::ScheduleTypeLimits::numericTypeValues
OpenStudio::Model::ScheduleTypeLimits::unitTypeValues

To answer your comment: they aren't "defined in OS App". Some objects in the hvac_library.osm have schedules that have scheduleTypeLimits attached to them, and when you add them to your model (this uses clone, which carries the child objects with it), they come with.

The hvac_library.osm itself is quite poorly optimized in this fashion:

# lib = osload('/Applications/OpenStudio-2.1.2/OpenStudioApp.app/Contents/Resources/hvaclibrary/hvac_library.osm')

In [1]: lib.getScheduleTypeLimitss.map{|s| s.name.to_s}

Out[1]: ["OnOff 1",
 "Dimensionless",
 "Temperature",
 "Schedule Type Limits 1",
 "OnOff",
 "Min Max Temp w Deadband Min Limits",
 "ControlMode",
 "OnOff 2",
 "Fractional",
 "Temperature 2",
 "Min Max Temp w Deadband Max Limits",
 "Temperature 3",
 "Dimensionless 2",
 "Temperature 1",
 "Fractional 1",
 "Schedule Type Limits 2",
 "Temperature 5",
 "Fractional 2",
 "Dimensionless 1",
 "Temperature 4"]

ScheduleTypeLimits is the object, it's already plural. If you need to get all of them, you need to append another s:

# Return an Array
model.getScheduleTypeLimitss

You could try getting them directly by name:

# Returns an optional, try `.empty?`then `.get`
model.getScheduleTypeLimitsByName("Fractional")

Of course you can use the array of ScheduleTypeLimits to filter on those that are Continuous only:

arr_continuous = []
model.getScheduleTypeLimitss.each do |s|
  next if s.numericType.empty?
  next if s.numericType.get != "Continuous"
  arr_continuous << s
end

Or the one-liner equivalent for fun:

model.getScheduleTypeLimitss.select{|s| (s.numericType.is_initialized) & (s.numericType.get == "Continuous")}

Just FYI, these two methods shall prove useful to return the possible values for numericType and unitType:

OpenStudio::Model::ScheduleTypeLimits::numericTypeValues
OpenStudio::Model::ScheduleTypeLimits::unitTypeValues

To answer your comment: they aren't "defined in OS App". Some objects in the hvac_library.osm hvac_library.osm have schedules some schedule that have scheduleTypeLimits scheduleTypeLimits attached to them, and when you add them to your model (this uses clone, which carries the child objects with it), they come with.

The hvac_library.osm hvac_library.osm itself is quite poorly optimized in this fashion:

# lib = osload('/Applications/OpenStudio-2.1.2/OpenStudioApp.app/Contents/Resources/hvaclibrary/hvac_library.osm')

In [1]: lib.getScheduleTypeLimitss.map{|s| s.name.to_s}

Out[1]: ["OnOff 1",
 "Dimensionless",
 "Temperature",
 "Schedule Type Limits 1",
 "OnOff",
 "Min Max Temp w Deadband Min Limits",
 "ControlMode",
 "OnOff 2",
 "Fractional",
 "Temperature 2",
 "Min Max Temp w Deadband Max Limits",
 "Temperature 3",
 "Dimensionless 2",
 "Temperature 1",
 "Fractional 1",
 "Schedule Type Limits 2",
 "Temperature 5",
 "Fractional 2",
 "Dimensionless 1",
 "Temperature 4"]