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

Shading control set point measure

asked 2017-02-01 23:25:06 -0600

revins's avatar

updated 2017-08-20 14:50:59 -0600

Based on the answers here and the minimal example here @Julien Marrec, I understand how to set the setpoint once I have the shading control object.

However, I don't want to create a new SC, but find all existing ones.

The following line:

scs = model.getObjectsByType("ShadingControl".to_IddObjectType)

returns an uninformative error:

 eval:1:in `initialize': Unknown Value (RuntimeError)

in an OpenStudio measure. Should I be using an EnergyPlus measure instead?

edit retag flag offensive close merge delete

Comments

A good place to start getting familiar with measures is the Measure Writing Guide as well as looking at example measures found on BCL for example.

Julien Marrec's avatar Julien Marrec  ( 2017-02-02 10:37:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-02-02 10:27:31 -0600

updated 2017-02-02 10:36:22 -0600

Use model.getShadingControls which will return an array of your shading controls.

Example: set all Shading Control's setpoint to 250:

model.getShadingControls.each do |sc|
   sc.setSetpoint(250)
end

Note that this is true of all objects in the OS API. If you want to get all Constructions in the model: model.getConstructions, etc.


Side note:

FYI, if you decompose your command call (always a good idea), you'll see that your problem is with ("ShadingControl".to_IddObjectType). This does work:

model.getObjectsByType("OS_ShadingControl".to_IddObjectType)

but it'll return an array of WorkspaceObject, that you'll have to cast to their actual object type (x.to_ShadingControl.get).

Bottom line: use model.getShadingControls!

edit flag offensive delete link more

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2017-02-01 23:25:06 -0600

Seen: 195 times

Last updated: Feb 02 '17