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

rename modelObject by ruby

asked 2017-01-05 17:17:24 -0500

dalin_si gravatar image

updated 2017-01-09 08:05:45 -0500

Hi I want to construct a new airloop in openstudio model using ruby bindings, now I know how to construct it but the name is defaulted:

irb(main):068:0>new_AirLoop = OpenStudio::Model::AirLoopHVAC.new(model)
irb(main):069:0> new_AirLoop.name.get
=> "Air Loop HVAC 1"

How can I change this name? Any suggestion?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-05 17:24:10 -0500

updated 2017-01-09 05:20:31 -0500

new_AirLoop.setName("A new Name") should do the trick!

edit flag offensive delete link more

Comments

Thanks, sorry to bother you but do you have any tutorial or other documentation? I barely find these material online.

dalin_si gravatar imagedalin_si ( 2017-01-05 17:32:18 -0500 )edit
1

The OpenStudio::Model object list can be found HERE which contains most of the methods needed for each model object. Some of the more general methods can be tricky to find, if you click on the 'inheritance diagram' for AirLoopHVAC you will see it traces back to OpenStudio::IdfObject which contains the setName() method, found HERE

Lyle K gravatar imageLyle K ( 2017-01-05 17:42:14 -0500 )edit
1

The OpenStudio measure writing guide found HERE will lead you to all the documentation available as well.

Lyle K gravatar imageLyle K ( 2017-01-05 17:45:22 -0500 )edit
1

Using new_airLoop.methods in an interactive prompt is also a good way to see what's available. The naming conventions in openstudio are generally pretty clear.

Julien Marrec gravatar imageJulien Marrec ( 2017-01-09 05:21:12 -0500 )edit

Your Answer

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

Add Answer

 



Question Tools

1 follower

Stats

Asked: 2017-01-05 17:17:24 -0500

Seen: 64 times

Last updated: Jan 09 '17