First time here? Check out the Help page!
1 | initial version |
The Zones
indeed all have the same origin at (0,0,0)
. It helps to visualize this stuff, here I loaded the model and removed the plenum zone in order to see things better. I've selected the zone that's the furthest away from the building origin (which is located at the intersection of the red, blue and green axis). The zone origin indeed is at (0,0,0).
It doesn't matter what the zone origin is as long as the Surfaces are entered properly.
If we look at the difference between the EAST PERIMETER
and WEST PERIMETER
Zones
Here's the min/max values for each coordinate (x, y, z) for the walls (see code to generate this below)
[1] (main)> west_walls => {:all_x=>[0.0, 3.7], :all_y=>[0.0, 15.2], :all_z=>[0.0, 2.4]} [2] (main)> east_walls => {:all_x=>[26.8, 30.5], :all_y=>[0.0, 15.2], :all_z=>[0.0, 2.4]}
So the walls for the "EAST PERIMETER" zone have much higher x
coordinates than "WEST PERIMETER" walls, which explains why they are placed where they are even though both Zones have the same origin.
Code to generate the above:
workspace = OpenStudio::Workspace.load('Exercise2C-Solution.idf').get
def get_xyz(w)
all_x = []
all_y = []
all_z = []
for i in 0..w.numExtensibleGroups-1
e = w.getExtensibleGroup(i)
all_x << e.getDouble(0).get
all_y << e.getDouble(1).get
all_z << e.getDouble(2).get
end
return all_x, all_y, all_z
end
west = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "WEST PERIMETER").get
east = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "EAST PERIMETER").get
#west_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
#east_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
west_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
east_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
workspace.getObjectsByType("BuildingSurface:Detailed".to_IddObjectType).each do |w|
if w.getString(1).to_s.upcase == 'WALL'
if w.getString(3).to_s.upcase == west.name.to_s.upcase
all_x, all_y, all_z = get_xyz(w)
west_walls[:all_x] += all_x
west_walls[:all_y] += all_y
west_walls[:all_z] += all_z
elsif w.getString(3).to_s.upcase == east.name.to_s.upcase
#east_walls[:walls] << w
all_x, all_y, all_z = get_xyz(w)
east_walls[:all_x] += all_x
east_walls[:all_y] += all_y
east_walls[:all_z] += all_z
end
end
end
west_walls.each {|k, v| west_walls[k] = v.minmax}
east_walls.each {|k, v| east_walls[k] = v.minmax}
2 | No.2 Revision |
The Zones
indeed all have the same origin at (0,0,0)
. It helps to visualize this stuff, here I loaded the model and removed the plenum zone in order to see things better. I've selected the zone that's the furthest away from the building origin (which is located at the intersection of the red, blue and green axis). The zone origin indeed is at (0,0,0).
It doesn't matter what the zone origin is as long as the Surfaces are entered properly.
If we look at the difference between the EAST PERIMETER
and WEST PERIMETER
Zones
Here's the min/max values for each coordinate (x, y, z) for the walls (see code to generate this below)
[1] (main)> west_walls
=> {:all_x=>[0.0, 3.7], :all_y=>[0.0, 15.2], :all_z=>[0.0, 2.4]}
[2] (main)> east_walls
=> {:all_x=>[26.8, 30.5], :all_y=>[0.0, 15.2], :all_z=>[0.0, So the walls for the "EAST PERIMETER" zone have much higher x
coordinates than "WEST PERIMETER" walls, which explains why they are placed where they are even though both Zones have the same origin.
Code to generate the above:
workspace = OpenStudio::Workspace.load('Exercise2C-Solution.idf').get
def get_xyz(w)
all_x = []
all_y = []
all_z = []
for i in 0..w.numExtensibleGroups-1
e = w.getExtensibleGroup(i)
all_x << e.getDouble(0).get
all_y << e.getDouble(1).get
all_z << e.getDouble(2).get
end
return all_x, all_y, all_z
end
west = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "WEST PERIMETER").get
east = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "EAST PERIMETER").get
#west_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
#east_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
west_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
east_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
workspace.getObjectsByType("BuildingSurface:Detailed".to_IddObjectType).each do |w|
if w.getString(1).to_s.upcase == 'WALL'
if w.getString(3).to_s.upcase == west.name.to_s.upcase
all_x, all_y, all_z = get_xyz(w)
west_walls[:all_x] += all_x
west_walls[:all_y] += all_y
west_walls[:all_z] += all_z
elsif w.getString(3).to_s.upcase == east.name.to_s.upcase
#east_walls[:walls] << w
all_x, all_y, all_z = get_xyz(w)
east_walls[:all_x] += all_x
east_walls[:all_y] += all_y
east_walls[:all_z] += all_z
end
end
end
west_walls.each {|k, v| west_walls[k] = v.minmax}
east_walls.each {|k, v| east_walls[k] = v.minmax}
3 | No.3 Revision |
The Zones
indeed all have the same origin at (0,0,0)
. It helps to visualize this stuff, here I loaded the model and removed the plenum zone in order to see things better. I've selected the zone that's the furthest away from the building origin (which is located at the intersection of the red, blue and green axis). The zone origin indeed is at (0,0,0).
It doesn't matter what the zone origin is as long as the Surfaces are entered properly.
If we look at the difference between the EAST PERIMETER
and WEST PERIMETER
Zones
Here's the min/max values for each coordinate (x, y, z) for the walls (see code to generate this below)
[1] (main)> west_walls
=> {:all_x=>[0.0, 3.7], :all_y=>[0.0, 15.2], :all_z=>[0.0, 2.4]}
[2] (main)> east_walls
=> {:all_x=>[26.8, 30.5], :all_y=>[0.0, 15.2], :all_z=>[0.0, 2.4]}
So the walls for the "EAST PERIMETER" zone have much higher x
coordinates than "WEST PERIMETER" walls, which explains why they are placed where they are even though both Zones have the same origin.
Code to generate the above:
workspace = OpenStudio::Workspace.load('Exercise2C-Solution.idf').get
def get_xyz(w)
all_x = []
all_y = []
all_z = []
for i in 0..w.numExtensibleGroups-1
e = w.getExtensibleGroup(i)
all_x << e.getDouble(0).get
all_y << e.getDouble(1).get
all_z << e.getDouble(2).get
end
return all_x, all_y, all_z
end
west = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "WEST PERIMETER").get
east = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "EAST PERIMETER").get
#west_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
#east_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
west_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
east_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
workspace.getObjectsByType("BuildingSurface:Detailed".to_IddObjectType).each do |w|
if w.getString(1).to_s.upcase == 'WALL'
if w.getString(3).to_s.upcase == west.name.to_s.upcase
all_x, all_y, all_z = get_xyz(w)
west_walls[:all_x] += all_x
west_walls[:all_y] += all_y
west_walls[:all_z] += all_z
elsif w.getString(3).to_s.upcase == east.name.to_s.upcase
#east_walls[:walls] << w
all_x, all_y, all_z = get_xyz(w)
east_walls[:all_x] += all_x
east_walls[:all_y] += all_y
east_walls[:all_z] += all_z
end
end
end
west_walls.each {|k, v| west_walls[k] = v.minmax}
east_walls.each {|k, v| east_walls[k] = v.minmax}
workspace = OpenStudio::Workspace.load('Exercise2C-Solution.idf').get
def get_xyz(w)
all_x = []
all_y = []
all_z = []
for i in 0..w.numExtensibleGroups-1
e = w.getExtensibleGroup(i)
all_x << e.getDouble(0).get
all_y << e.getDouble(1).get
all_z << e.getDouble(2).get
end
return all_x, all_y, all_z
end
west = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "WEST PERIMETER").get
east = workspace.getObjectByTypeAndName("Zone".to_IddObjectType, "EAST PERIMETER").get
#west_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
#east_walls = {:walls=>[], :all_x=>[], :all_y=>[], :all_z=>[]}
west_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
east_walls = {:all_x=>[], :all_y=>[], :all_z=>[]}
workspace.getObjectsByType("BuildingSurface:Detailed".to_IddObjectType).each do |w|
if w.getString(1).to_s.upcase == 'WALL'
if w.getString(3).to_s.upcase == west.name.to_s.upcase
all_x, all_y, all_z = get_xyz(w)
west_walls[:all_x] += all_x
west_walls[:all_y] += all_y
west_walls[:all_z] += all_z
elsif w.getString(3).to_s.upcase == east.name.to_s.upcase
#east_walls[:walls] << w
all_x, all_y, all_z = get_xyz(w)
east_walls[:all_x] += all_x
east_walls[:all_y] += all_y
east_walls[:all_z] += all_z
end
end
end
west_walls.each {|k, v| west_walls[k] = v.minmax}
east_walls.each {|k, v| east_walls[k] = v.minmax}