Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page

# Script to assign airwalls to selected space

Hey, I am trying to assign the "Surface" type Walls of a selected space to airwalls, through a script. I am able to get the surfaces of the selected space, check if they are Walls, and if their OutsideBoundaryCondition is "Surface", change the surface ConstructionName to "Air Wall". However, as I understand, for this script to work, adjacent surfaces to the surfaces assigned as airwalls (which would be part of the neighbouring space), need to be assigned to the same construction as well.

In SketchUp, the 'Outside Boundary Condition Object' provides this information, but I do not know how to access this information through code. The surface class reference in the documentation (http://mea-developer-nrel-legacy-down...) does not specify anything about the Outside Boundary Condition Object (different from the Outside Boundary Condition ) Is there a method to tell me what the adjacent surface is to a specific surface, or a method to access the information above via code? Any other suggestions to implement this idea better are also welcome! Thanks.

edit retag close merge delete

Sort by » oldest newest most voted

@gokulram to get the outsideBoundaryConditionObject, use surface.adjacentSurface. That returns a bool. After checking if it exists (which it should if boundary condition is "Surface") add a .get to get the surface.

But, OpenStudio has a tie breaker for constructions on matched surfaces that should fix the matched surface for you. Notice in the OS app that when I hard assign the air wall directly to a surface in the core zone, that the surface in the affected perimeter zone inherits that construction (shows as green). If the construction was non symmetrical then OpenStudio would use a mirrored version of it.

You can use inheritance diagram to see different places constructions can be applied. The deeper application is used when there is a conflict, with a hard assigned construction to a surface being the deepest, and a building level construction set being the shallowest.

Some example use cases for this are space types with construction sets for some surface types; such as an attic floor with insulation, or plenum floor, and also custom wall types like an medical imaging space type.

more

Found a minor bug. If you use a non-symmetrical construction the GUI looks like it uses the same construction, but on forward translation to IDF it does indeed create a mirrored construction. "My Construction" has new sibling object named "My Construction Reversed".

( 2016-11-28 12:33:52 -0600 )edit

@DavidGoldwasser thanks, this is very helpful!

( 2016-11-28 12:55:40 -0600 )edit

The method Surface::adjacentSurface(see here) should be what you're looking for.

more

Thanks @EricRingold!

( 2016-11-28 12:56:05 -0600 )edit