How does one insert daylighting shelves into model using a measure?
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 ...
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.
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