2

set vertices using OpenStudio API

I am writing a user script, to go into the OpenStudio SketchUp plugin, to add multiple horizontal shades over a window.

I don't understand why I can't change the vertices of an ShadingSurface object through the setVertices method.

sh1 = model.getShadingSurfaces[0]
p = OpenStudio::Point3d.new(1,1,1)
sh1.setVertices(p)
Error: #<TypeError: Expected argument 1 of type std::vector< openstudio::Point3d,std::allocator< openstudio::Point3d > > const &, but got OpenStudio::Point3d #<OpenStudio::Point3d:0x00024a...
    in SWIG method 'setVertices'>

How do I interpret that error message? Is it possible to create a ShadingSurface through the API, passing vertices to the constructor?

TomB's avatar
1.7k
TomB
asked 2017-06-02 23:10:17 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-06-03 07:12:31 -0500
edit flag offensive 0 remove flag close merge delete

Comments

You may want to look at Add rooftop PV measure for example. It copies the vertices from the roof surface, and offsets them vertically to create shading surfaces.

David Goldwasser's avatar David Goldwasser (2017-06-03 14:23:11 -0500) edit
add a comment see more comments

1 Answer

2

It's expecting a vector (of vertices) object, not a (single) vertex object.

__AmirRoth__'s avatar
4.4k
__AmirRoth__
answered 2017-06-03 07:11:50 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments