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 8 years ago

dalin_si's avatar

updated 8 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 8 years ago

updated 8 years ago

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

Preview: (hide)
link

Comments

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

dalin_si's avatar dalin_si  ( 8 years ago )
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's avatar Lyle K  ( 8 years ago )
1

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

Lyle K's avatar Lyle K  ( 8 years ago )
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's avatar Julien Marrec  ( 8 years ago )

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: 8 years ago

Seen: 201 times

Last updated: Jan 09 '17