First time here? Check out the Help page!
1 | initial version |
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")}
2 | No.2 Revision |
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
3 | No.3 Revision |
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"]
4 | No.4 Revision |
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"]