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

how to rename the schedule name by measure?

asked 2015-05-28 11:09:59 -0600

building_performance's avatar

updated 2017-08-05 13:23:21 -0600

(1)I generated a new schedule by measure script, by: myschedule=OpenStudio::Model::ScheduleRuleset.new(model,stuckpercentage); (2)Then i assigned the schedule "myschedule" to my Outdoor Air Damper, by: controlleroa.setMinimumFractionofOutdoorAirSchedule(myschedule); (3)Finally, after i applied the measure to OpenStudio test, the schedule name shown is: "Schedule Ruleset 1" from the schedule list. But i checked the values of "Schedule Ruleset 1" is what i gave during implementing the measure. So, how to rename the "Schedule Ruleset 1" to "myschedule"? I checked the source code of OpenStudio, there are no methods like: ResetScheduleName().

A snapshot from OpenStudio Measure is shown below:

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2015-05-28 14:45:36 -0600

Should look something like this.

# create new schedule
sch_ruleset = OpenStudio::Model::ScheduleRuleset.new(model)
sch_ruleset.setName("My Schedule")

If you just look at the ScheduleRuleset object you won't see "setName" https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-1.7.0-doc/model/html/classopenstudio11model11scheduleruleset.html

But if you click "List of all members" you will see it. https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-1.7.0-doc/model/html/classopenstudio11model11scheduleruleset-members.html

The second link shows all methods inherited from parent objects. You can click the "inheritance diagram" to see and jump to those objects. image description

edit flag offensive delete link more

Comments

Thanks a lot. But from the source code of OpenStudio, how can i get the inherited methods, like setName() method?

building_performance's avatar building_performance  ( 2015-05-28 15:48:46 -0600 )edit

The links I provided are built from the header files of the source code, so you are kind of browsing the source code. You can view as of the last major release or the last iteration (choose 'model' for the most part) . If you are going to browse code on GitHub you just have to get more familiar with the object inheritance.

David Goldwasser's avatar David Goldwasser  ( 2015-05-28 16:31:52 -0600 )edit

If you are browsing the source code directly it is more tedious. You have to find out what the base class is and then go open that base class's header file separately. For ScheduleRuleset you'll find here that it derives from Schedule. From here you will find that Schedule derives from ScheduleBase. Eventually you end up at ModelObject which defines ::setName.

Kyle Benne's avatar Kyle Benne  ( 2015-05-30 09:31:37 -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

Careers

Question Tools

1 follower

Stats

Asked: 2015-05-28 11:09:59 -0600

Seen: 161 times

Last updated: May 28 '15