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

set vertices using OpenStudio API

asked 2017-06-02 23:10:17 -0500

TomB's avatar

updated 2017-06-03 07:12:31 -0500

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?

edit retag flag offensive 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

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-06-03 07:11:50 -0500

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2017-06-02 23:10:17 -0500

Seen: 221 times

Last updated: Jun 03 '17