Skip to content

Instantly share code, notes, and snippets.

View MatthewSteen's full-sized avatar
💭
💻 🌎 🎧 🪿

Matt Steen MatthewSteen

💭
💻 🌎 🎧 🪿
  • USA
  • 11:12 (UTC -06:00)
View GitHub Profile
@MatthewSteen
MatthewSteen / get_class_names.rb
Created March 30, 2018 16:15
OpenStudio class names
# returns an array of OpenStudio class names with the prefix and colons removed
# searches the IDD for objects that start with the prefix, which is in EnergyPlus syntax with colons
def self.get_class_names(prefix)
array = []
os_prefix = "OS:#{prefix}"
factory = OpenStudio::IddFileAndFactoryWrapper.new('OpenStudio'.to_IddFileType)
factory.objects.each do |obj|
@MatthewSteen
MatthewSteen / get_plant_loop_supply_classes.rb
Last active March 30, 2018 16:13
OpenStudio supply component class names
# returns an array of supply component class names
def self.get_plant_loop_supply_classes(hvac_library_osm_path)
array = []
model = OpenStudio::Model::Model.load(hvac_library_osm_path).get
plant_loop = OpenStudio::Model::PlantLoop.new(model)
supply_outlet_node = plant_loop.supplyOutletNode
model.modelObjects.each do |obj|
@MatthewSteen
MatthewSteen / get_air_loop_supply_classes.rb
Last active March 30, 2018 16:14
OpenStudio supply component class names
# returns an array of supply component class_names
def self.get_air_loop_supply_classes(hvac_library_osm_path)
array = []
model = OpenStudio::Model::Model.load(hvac_library_osm_path).get
air_loop = OpenStudio::Model::AirLoopHVAC.new(model)
supply_outlet_node = air_loop.supplyOutletNode
model.modelObjects.each do |obj|