First time here? Check out the Help page!
1 | initial version |
There are a few ways to do this:
ModelObjects = model.getHVACComponents
waterHeaters = []
ModelObjects.each do |obj|
if obj.to_WaterHeaterMixed.is_initialized
obj = obj.to_WaterHeaterMixed.get
waterHeaters << obj
end
end
waterHeaters.each do |obj|
puts "#{obj.name}"
puts "#{obj.class}"
end
#Alternatively
waterHeaters = model.getWaterHeaterMixeds
2 | No.2 Revision |
There are a few ways to do this:
ModelObjects modelObjects = model.getHVACComponents
waterHeaters = []
ModelObjects.each modelObjects.each do |obj|
if obj.to_WaterHeaterMixed.is_initialized
obj = obj.to_WaterHeaterMixed.get
waterHeaters << obj
end
end
waterHeaters.each do |obj|
puts "#{obj.name}"
puts "#{obj.class}"
end
#Alternatively
waterHeaters = model.getWaterHeaterMixeds
3 | No.3 Revision |
There are a few ways to do this:
modelObjects = model.getHVACComponents
waterHeaters = []
modelObjects.each do |obj|
if obj.to_WaterHeaterMixed.is_initialized
obj = obj.to_WaterHeaterMixed.get
obj.to_WaterHeaterMixed.get #this line converts the object to a waterHeaterMixed object
waterHeaters << obj
end
end
waterHeaters.each do |obj|
puts "#{obj.name}"
puts "#{obj.class}"
end
#Alternatively
waterHeaters = model.getWaterHeaterMixeds
4 | No.4 Revision |
There are a few ways to do this:
modelObjects = model.getHVACComponents
waterHeaters = []
modelObjects.each do |obj|
if obj.to_WaterHeaterMixed.is_initialized
obj = obj.to_WaterHeaterMixed.get #this line converts #converts the object to a waterHeaterMixed object
waterHeaters << obj
end
end
waterHeaters.each do |obj|
puts "#{obj.name}"
puts "#{obj.class}"
end
#Alternatively
waterHeaters = model.getWaterHeaterMixeds