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

Revision history [back]

Remove Os:AirTerminal

Hello,

I have written a user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with every thing except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment Sketchup or Openstudio will crash after removing. This is my code:

def removeUnusedThermalZones(model) thermal_zones = model.getThermalZones

thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
equipmentListToRemove = []

thermal_zones.each do |thermal_zone|
  if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
    thermal_zone_handles_to_remove << thermal_zone.handle
    if not thermal_zone.equipment.empty?
      thermal_zone.equipment.each do |equip| 
        equipmentListToRemove<< equip
      end
    end        
  end

end

if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) puts "Eliminando #{thermal_zone_handles_to_remove.size} thermal zones." else puts "No unused thermal zones to remove." end
end

Remove Os:AirTerminal

Hello,

I have written a user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with every thing except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment equipment, Sketchup or Openstudio will crash after removing. This is my code:

def removeUnusedThermalZones(model) thermal_zones = model.getThermalZones

thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
equipmentListToRemove = []

thermal_zones.each do |thermal_zone|
  if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
    thermal_zone_handles_to_remove << thermal_zone.handle
    if not thermal_zone.equipment.empty?
      thermal_zone.equipment.each do |equip| 
        equipmentListToRemove<< equip
      end
    end        
  end

end

if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) puts "Eliminando #{thermal_zone_handles_to_remove.size} thermal zones." else puts "No unused thermal zones to remove." end
end

Remove Os:AirTerminal

Hello,

I have written a user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with every thing except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is my code:

def removeUnusedThermalZones(model) thermal_zones = model.getThermalZones

thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
equipmentListToRemove = []

thermal_zones.each do |thermal_zone|
  if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
    thermal_zone_handles_to_remove << thermal_zone.handle
    if not thermal_zone.equipment.empty?
      thermal_zone.equipment.each do |equip| 
        equipmentListToRemove<< equip
      end
    end        
  end

end

if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) puts "Eliminando #{thermal_zone_handles_to_remove.size} thermal zones." else puts "No unused thermal zones to remove." end
end

Remove Os:AirTerminal

Hello,

I have written a modify the user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with every thing except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is my the code:

def removeUnusedThermalZones(model) thermal_zones = model.getThermalZones

thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
equipmentListToRemove = []

thermal_zones.each do |thermal_zone|
  if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
    thermal_zone_handles_to_remove << thermal_zone.handle
    if not thermal_zone.equipment.empty?
      thermal_zone.equipment.each do |equip| 
        equipmentListToRemove<< equip
      end
    end        
  end

end

if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) puts "Eliminando #{thermal_zone_handles_to_remove.size} thermal zones." else puts "No unused thermal zones to remove." end
end

Remove Os:AirTerminal

Hello,

I have modify the user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with every thing everything except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is the code:

def removeUnusedThermalZones(model) thermal_zones = model.getThermalZones

thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
equipmentListToRemove = []

thermal_zones.each do |thermal_zone|
  if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
    thermal_zone_handles_to_remove << thermal_zone.handle
    if not thermal_zone.equipment.empty?
      thermal_zone.equipment.each do |equip| 
        equipmentListToRemove<< equip
      end
    end        
  end

end

if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) puts "Eliminando #{thermal_zone_handles_to_remove.size} thermal zones." else puts "No unused thermal zones to remove." end
end

Remove Os:AirTerminal

Hello,

I have modify the user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with everything except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is the code:

def removeUnusedThermalZones(model) thermal_zones = model.getThermalZones

thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
equipmentListToRemove = []

thermal_zones.each do |thermal_zone|
  if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
    thermal_zone_handles_to_remove << thermal_zone.handle
    if not thermal_zone.equipment.empty?
      thermal_zone.equipment.each do |equip| 
        equipmentListToRemove<< equip
      end
    end        
  end

end

if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) puts "Eliminando #{thermal_zone_handles_to_remove.size} thermal zones." else puts "No unused thermal zones to remove." end
end

Remove Os:AirTerminal

Hello,

I have modify the user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with everything except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is the code:

def removeUnusedThermalZones(model)
   thermal_zones = model.getThermalZones

model.getThermalZones

  thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
 equipmentListToRemove = []

 thermal_zones.each do |thermal_zone|
   if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
     thermal_zone_handles_to_remove << thermal_zone.handle
     if not thermal_zone.equipment.empty?
       thermal_zone.equipment.each do |equip| 
         equipmentListToRemove<< equip
      end
    end        
  end

end

end end end end if not equipmentListToRemove .empty? equipmentListToRemove .each {|equip| equip.remove } end

end if not thermal_zone_handles_to_remove.empty? model.removeObjects(thermal_zone_handles_to_remove) else puts "No unused thermal zones to remove." end
end

end end

Remove Os:AirTerminal

I have modify the user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with everything except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is the code:

def removeUnusedThermalZones(model)
  thermal_zones = model.getThermalZones

  thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
  equipmentListToRemove = []

  thermal_zones.each do |thermal_zone|
    if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
      thermal_zone_handles_to_remove << thermal_zone.handle
      if not thermal_zone.equipment.empty?
        thermal_zone.equipment.each do |equip| 
          equipmentListToRemove<< equip
        end
      end
    end
  end

  if not equipmentListToRemove .empty?
    equipmentListToRemove .each equipmentListToRemove.empty?
    equipmentListToRemove.each {|equip|
      equip.remove
    }
  end

  if not thermal_zone_handles_to_remove.empty?
    model.removeObjects(thermal_zone_handles_to_remove)
  else
    puts "No unused thermal zones to remove."
  end
end

Remove Os:AirTerminal

I have modify modified the user script to remove unused thermal zones (they remain after deleting the space). Before deleting the thermal zone, I delete the zone equipment. It works fine with everything except with AirTerminal type equipment. If there is an AirTerminal in the zone equipment, Sketchup or Openstudio will crash after removing. This is the code:

def removeUnusedThermalZones(model)
  thermal_zones = model.getThermalZones

  thermal_zone_handles_to_remove = OpenStudio::UUIDVector.new
  equipmentListToRemove = []

  thermal_zones.each do |thermal_zone|
    if thermal_zone.spaces.empty?  && thermal_zone.isRemovable
      thermal_zone_handles_to_remove << thermal_zone.handle
      if not thermal_zone.equipment.empty?
        thermal_zone.equipment.each do |equip| 
          equipmentListToRemove<< equip
        end
      end
    end
  end

  if not equipmentListToRemove.empty?
    equipmentListToRemove.each {|equip|
      equip.remove
    }
  end

  if not thermal_zone_handles_to_remove.empty?
    model.removeObjects(thermal_zone_handles_to_remove)
  else
    puts "No unused thermal zones to remove."
  end
end