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

Measure to change wall material by facade [closed]

asked 2016-05-19 09:06:06 -0600

FSilenzi's avatar

updated 2017-08-05 07:57:10 -0600

I am modeling a very big building, and I need to differentiate the materials of the north and south facade. I have yet calculated thermal bidges effect and I have defined two new constructions. Now, usually for the windows I use this measure to assign different W/W ratios for facades and then assign by hand the constructions. This is possible because the fenestrations created by the measures are very big and they are only 4 for each building store. This is not the case for wall surfaces, and the manual assignment process is time consuming (also because the computer takes ages to load after every surface box check click). Also, the chances I can missclick a surface or miss one are very high.

The question is then, does anybody have developed a measure able to assign constructions to external walls differentiating them by facade?

I have found this measure for windows.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by FSilenzi
close date 2016-05-23 10:11:14.374691

Comments

Please use existing tags as much as possible, and don't forgot to tag the software you're using. Here openstudio and openstudio-measure should definitely be used!

Julien Marrec's avatar Julien Marrec  ( 2016-05-19 09:54:51 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
5

answered 2016-05-19 09:49:44 -0600

updated 2016-05-23 03:04:58 -0600

Feel free to adapt the following code, it'll give you some training on measures too! I'd personally not create an actual measure for this, I'd just open a terminal window and do some interactive ruby on my model, but that's just me.

# If interactive, load model
path = 'C:\mymodel.osm'
translator = OpenStudio::OSVersion::VersionTranslator.new
ospath = OpenStudio::Path.new(path)
model = translator.loadModel(ospath)
if model.empty?
    raise "Path #{path} is not a valid path to an OpenStudio Model"
else
    model = model.get
end    

# Find the north walls, with a big tolerance here.
between_deg = -25
until_deg = 25

# Conversions to SI units
between_rad = OpenStudio::convert(between_deg,"deg","rad").get
until_rad = OpenStudio::convert(until_deg,"deg","rad").get


# Construction: adapt to grep the construction you actually need
construction = model.getConstructionByName("North Construction").get

model.getSurfaces.each do |surface|
  # Find exterior walls only
  next if surface.outsideBoundaryCondition != "Outdoors"
  next if surface.surfaceType != "Wall"


  # Filter on azimuth: OpenStudio works CLOCKWISE (different from classic trigonometry), and returns it in radians
  # Also doesn't take care of the Building North Axis, it'll be in your original drawing (that's usually easier anyways)
  # If you want the north wall: 0, east: Pi/2, south: Pi , west: 3*Pi/2

  # Filter on azimuth
  azimuth = surface.azimuth
  # Case where start point was negative
  if between_rad > until_rad
      next if (azimuth > until_rad) && (azimuth < between_rad)
  else
      next if (azimuth < between_rad) || (azimuth > until_rad)
  end

  # Assign the construction to the surface
  surface.setConstruction(construction)
  puts "Assigned construction to #{surface.name} which has an azimuth of #{OpenStudio::convert(azimuth,"rad","deg").get} degrees"
end
edit flag offensive delete link more

Comments

The terminal window is the ruby console that appears, for instance when I run the disgnostic scrpit in schetup? How can I open it and in what software?

FSilenzi's avatar FSilenzi  ( 2016-05-23 02:39:16 -0600 )edit

I meant terminal as in command prompt or Powershell on windows, terminal on Unix systems.

See the Introductory Tutorial under "Optional - Install Ruby". Make sure you do install Ruby 2.0.0 and not the later versions (it won't work).

And of course change the require 'C:\Program Files (x86)\OpenStudio 1.7.0\Ruby\openstudio.rb' to whatever version you're using, like require 'C:\Program Files (x86)\OpenStudio 1.11.3\Ruby\openstudio.rb'

Julien Marrec's avatar Julien Marrec  ( 2016-05-23 02:59:43 -0600 )edit

I edited the above to show you how to load your model if you choose to try the SDK in command prompt

Julien Marrec's avatar Julien Marrec  ( 2016-05-23 03:05:27 -0600 )edit

I have made my way trough point 5:"Test your installation by opening a command prompt and typing: irb ENTER. Then, type require 'openstudio ENTER. If you see some QSslSocket messages and => true, it's working." I open the cmd command window but when I write irb it gives me back an error telling me that the computer does not know irb as a command.

FSilenzi's avatar FSilenzi  ( 2016-05-23 03:17:08 -0600 )edit

I think it would be better to guide you on Slack rather than clutter this comment thread. Anyways, this is probably because you've failed to do 2. Add C:\Ruby200\bin to the PATH.

Julien Marrec's avatar Julien Marrec  ( 2016-05-23 05:38:59 -0600 )edit
3

answered 2016-05-19 09:46:22 -0600

I'm not aware of a measure that does this, but the one you pointed to that changes window construction by orientation would be a good one to copy and modify.

If you are not up for writing a measure I can think of one other approach. The OpenStudio SketchUp Plugin has a surface search tool (looks like filter) that lets you search for surfaces based on orientation, you define a range of degrees to include. Then you could use an existing user script that changes the selected surfaces to adiabatic and also hard assigns a construction to those surfaces. If you comment out the line of code in that user script that changes the boundary condition, this will do just want you want. If you don't want to alter the script, you can open the model in the OpenStudio application after running the script and saving the model. Then you can use the multi-select feature of grid view on the "Surfaces" sub tab of the "Space" tab to change the boundary condition back to "Outdoors".

If you want to alter the user script change line 52 from

surface.setOutsideBoundaryCondition("Adiabatic")

to

#surface.setOutsideBoundaryCondition("Adiabatic")
edit flag offensive delete link more

Comments

I managed to modify the script, and it worked like a charm.

FSilenzi's avatar FSilenzi  ( 2016-05-23 10:10:49 -0600 )edit

Cool. For future reference for others looking for script it is under your OpenStudio Installation folder.

OpenStudio 1.11.0/Ruby/openstudio/sketchup_plugin/user_scripts/Alter or Add Model Elements
David Goldwasser's avatar David Goldwasser  ( 2016-05-23 10:45:43 -0600 )edit

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2016-05-19 09:06:06 -0600

Seen: 404 times

Last updated: May 23 '16