First time here? Check our help page!
2

Remove specified zone equipment using measure

I have model with FCU and PAU.
I am trying to remove FCU from zones writing measure by myself referring to this post.
However, in this method, PAU terminal is also removed.
Does anyone know how I can specify the terminal which should be removed from thermal zone?

katsuya.obara's avatar
2.1k
katsuya.obara
asked 2018-05-26 05:32:50 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2018-05-26 12:29:34 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

There are a few approaches, the most basic is to filter by name before removing it, but you could also filter by object type, which would be more flexible if there isn't a common element to the names of the objects you want to remove, or if the object names are unknown.

zone.equipment.each do |zone_equipment|
  next if not zone_equipment.name.to_s.include?(test_string)
  zone_equipment.remove
end

The test_string variable could be hard coded in the measure or could be a user argument.

David Goldwasser's avatar
20.4k
David Goldwasser
answered 2018-05-26 22:15:57 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments