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

Revision history [back]

Can you monkey-patch openstudio objects?

This is more of a theoretical question for my own curiosity, but is it possible to monkey-patch OpenStudio objects, especially to add attributes (tags)?

In some objects such as OS:Space, there are "Measure tags" which are useful in order to selectively apply measure to only some but not all.

For example is it possible to add a tag for some surfaces?

If you just try to add another attribute in a text editor the resulting .osm won't load because it won't pass draft strictness compared to the OpenStudio IDD.

Can you monkey-patch openstudio objects?

This is more of a theoretical question for my own curiosity, but is it possible to monkey-patch OpenStudio objects, especially to add attributes (tags)?

In some objects such as OS:Space, there are "Measure tags" which are useful in order to selectively apply measure to only some but not all.

For example is it possible to add a tag for some surfaces?

If you just try to add another attribute in a text editor the resulting .osm won't load because it won't pass draft strictness compared to the OpenStudio IDD.