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

Revision history [back]

click to hide/show revision 1
initial version

adjacent surface

The following excerpt from a measure.rb file is to get all surface of a "plenum" space that are of type "Floor" and have a "Surface" outside boundary condition. The lines "puts plenumSurface.name.get.to_s" and "puts plenumSurface.handle" show the results expected from reviewing the SketchUp/OpenStudio file and from reviewing the .OSM file. (I could then also use "plenumSurface.setConstruction(construction)" to assign construction to each of these surfaces, though I have not shown that below.)

However, I will also have to assign this construction to the adjacent surfaces for each of the above plenumSurface. So, I thought, I'd just use plenumSurface.adjacentSurface instead of plenumSurface to accomplish that. However, it seems that plenumSurface.adjacentSurface is a totally different class than plenumSurface. For example, ".name.get.to_s" and ".handle" work on plenumSurface, but not on plenumSurface.adjacentSurface. What gives?

plenumSurfaces = plenum.surfaces
plenumSurfaces.each do |plenumSurface|
  if plenumSurface.surfaceType == "Floor" and plenumSurface.outsideBoundaryCondition == "Surface"
    puts plenumSurface.name.get.to_s
    puts plenumSurface.handle
    puts plenumSurface.adjacentSurface.get.to_s # DOES NOT WORK!
    puts plenumSurface.adjacentSurface.handle # DOES NOT WORK!
  end
end

Thanks for any assistance you might be able to provide.

adjacent surface

The following excerpt from a measure.rb file is to get all surface of a "plenum" space that are of type "Floor" and have a "Surface" outside boundary condition. The lines "puts plenumSurface.name.get.to_s" and "puts plenumSurface.handle" show the results expected from reviewing the SketchUp/OpenStudio file and from reviewing the .OSM file. (I could then also use "plenumSurface.setConstruction(construction)" to assign construction to each of these surfaces, though I have not shown that below.)

However, I will also have to assign this construction to the adjacent surfaces for each of the above plenumSurface. So, I thought, I'd just use plenumSurface.adjacentSurface instead of plenumSurface to accomplish that. However, it seems that plenumSurface.adjacentSurface is a totally different class than plenumSurface. For example, ".name.get.to_s" and ".handle" work on plenumSurface, but not on plenumSurface.adjacentSurface. What gives?

plenumSurfaces = plenum.surfaces
plenumSurfaces.each do |plenumSurface|
  if plenumSurface.surfaceType == "Floor" and plenumSurface.outsideBoundaryCondition == "Surface"
    puts plenumSurface.name.get.to_s
    puts plenumSurface.handle
    puts plenumSurface.adjacentSurface.get.to_s # DOES NOT WORK!
    puts plenumSurface.adjacentSurface.handle # DOES NOT WORK!
  end
end

Thanks for any assistance you might be able to provide.

adjacent surface

The following excerpt from a measure.rb file is to get all surface of a "plenum" space that are of type "Floor" and have a "Surface" outside boundary condition. The lines "puts plenumSurface.name.get.to_s" and "puts plenumSurface.handle" show the results expected from reviewing the SketchUp/OpenStudio file and from reviewing the .OSM file. (I could then also use "plenumSurface.setConstruction(construction)" to assign construction to each of these surfaces, though I have not shown that below.)

However, I will also have to assign this construction to the adjacent surfaces for each of the above plenumSurface. So, I thought, I'd just use plenumSurface.adjacentSurface instead of plenumSurface to accomplish that. However, it seems that plenumSurface.adjacentSurface is a totally different class than plenumSurface. For example, ".name.get.to_s" and ".handle" work on plenumSurface, but not on plenumSurface.adjacentSurface. What gives?

plenumSurfaces = plenum.surfaces
plenumSurfaces.each do |plenumSurface|
  if plenumSurface.surfaceType == "Floor" and plenumSurface.outsideBoundaryCondition == "Surface"
    puts plenumSurface.name.get.to_s
    puts plenumSurface.handle
    puts plenumSurface.adjacentSurface.get.to_s # DOES NOT WORK!
    puts plenumSurface.adjacentSurface.handle # DOES NOT WORK!
  end
end

Thanks for any assistance you might be able to provide.