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

Revision history [back]

Another case of asking a question and finding the answer right after.

Each surface (and subsurface) has a setVertices method which accepts a vector of Point3d.

Let's say you want to only change the third vertices of a triangle. s is a Surface or SubSurface

# First two points stay the same
a = s.vertices[0]
b = s.vertices[1]

# Create a new point at (x, y, z) = (0, 1, 2)
c_prime = OpenStudio::Point3d.new(0, 1, 2)

# Do the change
s.setVertices([a, b, c_prime])