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

AdditionalProperties

asked 2018-06-22 11:38:24 -0500

updated 2018-06-23 10:43:25 -0500

I have noticed that OpenStudio 2.5 includes a new class: OpenStudio::Model::AdditionalProperties

I am trying to write some userscripts and measures and it would be very helpful to use this objet. The problem is I dont know how to create this object and how to assign it to the openstudio models.

Can anybody provide a simple use example?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-06-22 14:43:58 -0500

updated 2018-06-22 15:34:57 -0500

Every OpenStudio model object now has an AdditionalProperties object available on it to store meta information. If you ask for the object and it doesn't already exist, it is automatically created for you. Once you have the object, see the OpenStudio SDK documentation for all of the available methods.

For example:

mat = OpenStudio::Model::StandardOpaqueMaterial.new(model)
props = mat.additionalProperties
props.setFeature("color", "white")
puts props.getFeatureAsString("color") # => "white"
edit flag offensive delete link more

Comments

It works. Thank you!

mapascual gravatar imagemapascual ( 2018-06-23 01:32:13 -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: 2018-06-22 11:38:24 -0500

Seen: 93 times

Last updated: Jun 22 '18