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

Adding objects, fields in OpenStudio IDD using OpenStudio SDK

asked 2025-07-01 09:32:47 -0500

KP's avatar

updated 2025-07-01 15:24:55 -0500

Hi All,

I want to programmatically add custom objects and fields in the OpenStudio IDD using the OpenStudio SDK (C# bindings). Is it possible?

Upon surfing the internet, it appears that in OpenStudio's C# API, we cannot modify the OpenStudio IddFile or its contained IddObjects directly (such as adding a new field to OS: Building) because OpenStudio's IddFile structure is considered read-only once loaded from disk.

However, when I edit the IDD file directly (through a text editor), I can read/retrieve the custom added objects and fields. This could be an alternative option!

Any advice on this would be greatly appreciated.

edit retag flag offensive close merge delete

Comments

I'm curious what you want to achieve here?

Julien Marrec's avatar Julien Marrec  ( 2025-07-03 09:30:17 -0500 )edit
1

We are working on a DOE project that requires adding new compliance parameters (fields) to the existing openStudio objects. For this, we modified the OpenStudio IDD file (through a text editor). This method works fine. Meanwhile, I am exploring the option of whether this can be done programmatically using the OpenStudio SDK. Thanks

KP's avatar KP  ( 2025-07-07 08:32:37 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2025-07-01 17:21:56 -0500

Yes, you can use the AdditionalProperties object, which allows storing custom information on any OpenStudio model object. See here for a post that gives some more information and an example.

edit flag offensive delete link more

Comments

Technically it doesn't allow creating custom objects, but it does allow custom fields. You could represent a custom object with multiple fields using a certain convention (like "objectname_fieldname1", "objectname_fieldname2", etc.).

shorowit's avatar shorowit  ( 2025-07-01 17:24:26 -0500 )edit

@shorowit: Thanks. Yes. I was able to create a new custom field, but not a new object in the OpenStudio Idd file. Additionally, I’m unable to associate the newly created field with an existing object. Appreciate your response.

KP's avatar KP  ( 2025-07-01 17:29:20 -0500 )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

Question Tools

1 follower

Stats

Asked: 2025-07-01 09:32:47 -0500

Seen: 60 times

Last updated: Jul 01