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

Revision history [back]

This code snippet from the measures repo should help you:

# create a new set of vertices
newVertices = OpenStudio::Point3dVector.new

# get the existing vertices for this interior partition
vertices = surface.vertices

vertices.each do |vertex|

  # initialize new vertex to old vertex
  x = vertex.x
  y = vertex.y
  z = 0

  # add point to new vertices
  newVertices << OpenStudio::Point3d.new(x,y,z)
end

# set vertices to new vertices
surface.setVertices(newVertices) #todo check if this was made, and issue warning if it was not. Could happen if resulting surface not planar.

This code snippet from the measures repo should help you:

# create a new set of vertices
newVertices = OpenStudio::Point3dVector.new

# get the existing vertices for this interior partition
vertices = surface.vertices

vertices.each do |vertex|

  # initialize new vertex to old vertex
  x = vertex.x
  y = vertex.y
  z = 0
vertex.z - 1

  # add point to new vertices
  newVertices << OpenStudio::Point3d.new(x,y,z)
end

# set vertices to new vertices
surface.setVertices(newVertices) #todo check if this was made, and issue warning if it was not. Could happen if resulting surface not planar.