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

How does one insert daylighting shelves into model using a measure?

asked 2017-11-20 12:52:14 -0600

pep4life gravatar image

updated 2017-11-20 13:14:42 -0600

Hi, I've searched Unmet Hours for some direction on my question and found only 3 posts.
My goal is to place daylight shelves on the equator-facing wall of a single room, to obtain even light distribution. I only want to see if this will actually work, by installing them, running a simulation, and then studying the DC maps. I altered an existing measure (as understood from this post) to add a single light shelf, and although the measure runs, no light shelves are actually added.

Here's what has happened between my goal and my problem:

With some background in Python, I did some Ruby tutorials and started studying some measures for structure and hierarchy, in particular, the ''AddOverhangsByProjectionFactor' and 'AEDGSmallToMediumOfficeFenestrationAndDaylightingControls' measures. I would like only to see if adding light shelves will in fact help me reach my goal, so I'm not after extra functionality. So I started really small to get a single light shelf on one wall, naming the targeted SubSurface inside the .rb file itself. Studying the SDK documentation and the Measure Writing Guide on Git and on OS website, and taking cues from the measures I studied, addDaylightingDeviceShelf() seemed a good method to choose. But since this method returns an 'OptionalDaylightingShelf'; thus, I checked if it was empty and finding it wasn't, I tried to use the "get" method to see what the variable was pointing to. But the .get method called on this object is not recognized. (However, the measure does run without calling the "get" method, although without any light shelves inserted into the model.)

Here is my code trying the get method (I include the entire measure, so that if anything is missed, it will be obvious):

# start the measure

class AddDaylightShelvesToEquatorFacingWall < OpenStudio::Ruleset::ModelUserScript

# define the name that the user will see ... human readable def name return "Add Daylight Shelves to Equator-facing Wall" # "Add Remove Or Replace Window Overhangs" end

# human readable description def description return "This measure adds daylighting shelves to the equator-facing wall, or to wall specified by the user, at the user-specified width.
Daylighting shelves are useful in creating occupant comfort, both visual and thermal, thus increasing work productivity.
Daylight shelves bounce daylight off ceiling surfaces, thus pushing light further into a building and reducing the need for artificial lighting at certain times of day. If properly designed, they can help to reduce the excessive use of blinds for glare protection, and thus allow for occupant view and more effective use of a space. In combination with exterior shading, daylight shelves evenly distribute light and avoid stark light/dark contrasts and glare over the work plane. Daylighting shelves require high floor to ceiling heights to be effective, given the requirement for daylighting windows (above the daylight shelves positioned above eye level) in addition to view windows below. Note that in some jurisdictions, daylight shelves have a maximum width requirement, due to coordination with sprinkler code requirements. Upper surface of shelves must have high reflectance." end ... (more)

edit retag flag offensive close merge delete

Comments

To clarify, the last bit of the third last paragraph actually reads: I fail to understand (nor could I find any documentation that explains) the const and & C + + keywords required in the argument for the method: DaylightingDeviceShelf (const SubSurface &subSurface). Any clarification would be greatly appreciated.

pep4life gravatar image pep4life  ( 2017-11-20 12:56:20 -0600 )edit

How can I correct the below code? Thank you

new_lightshelf =subsurfaces[11].addDaylightingDeviceShelf()

<openstudio::model::optionaldaylightingdeviceshelf:0x0001c817a91b78>

new_lightshelf.empty? false aa=new_lightshelf.get OS:DaylightingDevice:Shelf, {d3e8c95e-9f08-4a58-acf4-c2b79d7df8c4}, !- Handle Daylighting Device Shelf 1, !- Name {72f98f0b-6b8a-4ba6-920d-83994f4287e7}; !- Window Name aa.class OpenStudio::Model::DaylightingDeviceShelf aa.name Daylighting Device Shelf 1

Fatima1991 gravatar image Fatima1991  ( 2021-07-19 11:21:42 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2017-11-20 14:57:54 -0600

Avi gravatar image

updated 2017-11-21 00:10:39 -0600

The .get method called on boost object works fine: here is what I was running to test that in SketchUp's Ruby console:

sketchup_model = Sketchup.active_model
model = sketchup_model.model_interface.openstudio_model


new_lightshelf =subsurfaces[11].addDaylightingDeviceShelf() 
#<OpenStudio::Model::OptionalDaylightingDeviceShelf:0x0001c817a91b78>
new_lightshelf.empty?
false
aa=new_lightshelf.get
OS:DaylightingDevice:Shelf,
  {d3e8c95e-9f08-4a58-acf4-c2b79d7df8c4}, !- Handle
  Daylighting Device Shelf 1,             !- Name
  {72f98f0b-6b8a-4ba6-920d-83994f4287e7}; !- Window Name
aa.class
OpenStudio::Model::DaylightingDeviceShelf
aa.name
Daylighting Device Shelf 1
edit flag offensive delete link more

Comments

Thanks for the quick reply! I tried to test the same in Ruby Console, but it doesn't recognize open studio objects, only sketch-up ones -- i.e. Calling up the active model in order to get the subsurfaces yields only the sketch-up option, and using the reference tool to get an entity doesn't yield a SubSurface, but instead a Face: model = Sketchup.active_model

<sketchup::model:0x007f93fba1bbc0>

subsurface=face

<sketchup::face:0x007f93fb7d2e90>

Could this be b/c I haven't updated sketch-up make to 2018? Or is there a preamble I'm missing, to initiate the option to call the OS model?

pep4life gravatar image pep4life  ( 2017-11-20 17:15:41 -0600 )edit

I edited my answer to include the model definition. Use with caution

Avi gravatar image Avi  ( 2017-11-21 00:11:27 -0600 )edit
1

answered 2017-11-21 18:50:59 -0600

pep4life gravatar image

updated 2017-11-21 18:53:00 -0600

Thank you so much! Your suggestions were super helpful! Turns out, I got the daylight shelves into my model through a combination of code in SU's Ruby Console and steps in the OS GUI. In case anyone else needs daylight shelves, this is how I did it:

  1. Ruby console code (as per Avi's comments) to add the light shelf objects to the model and to create the light shelf construction; (after this step, the light shelves are not yet visible in the model)

  2. Then, in the SU plugin, I drew the interior partition surfaces in the positions I wanted them;

  3. In the OS App, under the Space tab's SubSurface sub-tab for Daylight Shelves, I dropped the interior partition onto my Subsurface's Inside Shelf Name field.

  4. Then in the OS App's Constructions tab, I selected the Interior Partition construction and dropped my chosen light-shelf material (with relevant properties, etc.) onto the interior partition construction.

Ready and set to go for a simulation run to generate some daylight coefficient maps to check out illuminance values in my space, with and without the daylight shelves! Exciting stuff! :) Thanks so much!

edit flag offensive delete link more

Comments

How can I correct the below code? Thank you

new_lightshelf =subsurfaces[11].addDaylightingDeviceShelf()

<openstudio::model::optionaldaylightingdeviceshelf:0x0001c817a91b78>

new_lightshelf.empty? false aa=new_lightshelf.get OS:DaylightingDevice:Shelf, {d3e8c95e-9f08-4a58-acf4-c2b79d7df8c4}, !- Handle Daylighting Device Shelf 1, !- Name {72f98f0b-6b8a-4ba6-920d-83994f4287e7}; !- Window Name aa.class OpenStudio::Model::DaylightingDeviceShelf aa.name Daylighting Device Shelf 1

Fatima1991 gravatar image Fatima1991  ( 2021-07-19 11:21:04 -0600 )edit

Your Answer

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

Add Answer

Training Workshops

Question Tools

1 follower

Stats

Asked: 2017-11-20 12:52:14 -0600

Seen: 302 times

Last updated: Nov 21 '17