Skip to content

SubSurface Type reset when assigned to surface #3936

@shorowit

Description

@shorowit

Issue overview

Running the following script:

require 'openstudio'

model = OpenStudio::Model::Model.new

surf_polygon = OpenStudio::Point3dVector.new
surf_polygon << OpenStudio::Point3d.new(0, 0, 0)
surf_polygon << OpenStudio::Point3d.new(0, 10, 0)
surf_polygon << OpenStudio::Point3d.new(0, 10, 10)
surf_polygon << OpenStudio::Point3d.new(0, 0, 10)
surf = OpenStudio::Model::Surface.new(surf_polygon, model)

door_polygon = OpenStudio::Point3dVector.new
door_polygon << OpenStudio::Point3d.new(0, 1, 1)
door_polygon << OpenStudio::Point3d.new(0, 9, 1)
door_polygon << OpenStudio::Point3d.new(0, 9, 9)
door_polygon << OpenStudio::Point3d.new(0, 1, 9)
subsurf = OpenStudio::Model::SubSurface.new(door_polygon, model)
subsurf.setSubSurfaceType('Door')

puts subsurf.subSurfaceType # should be Door, and is Door

subsurf.setSurface(surf)

puts subsurf.subSurfaceType # should still be Door, but is now FixedWindow

I expect it to say Door twice, but instead it produces:

Door
FixedWindow

I can workaround this by setting the subsurface type after the door is assigned to the surface.

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): Windows 10
  • Version of OpenStudio (if using an intermediate build, include SHA): OpenStudio 2.9.1

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions