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

Script to assign airwalls to selected space

asked 2016-11-28 11:47:55 -0600

gokul gravatar image

updated 2017-08-05 07:43:44 -0600

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' SketchUp Imageprovides 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 flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-11-28 12:25:53 -0600

updated 2016-11-28 14:07:23 -0600

@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.

image description

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.

edit flag offensive delete link 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".

David Goldwasser gravatar image David Goldwasser  ( 2016-11-28 12:33:52 -0600 )edit

@DavidGoldwasser thanks, this is very helpful!

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

answered 2016-11-28 12:20:17 -0600

updated 2016-11-28 12:20:55 -0600

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

edit flag offensive delete link more


Thanks @EricRingold!

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

Your Answer

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

Add Answer


Question Tools

1 follower


Asked: 2016-11-28 11:47:55 -0600

Seen: 213 times

Last updated: Nov 28 '16