Examples of OS SDK for HVAC modification in PO/HB openstudio workflow?

Hi @TrevorFedyna ,

If you are looking to get your feet wet with customizing HVAC systems using the OpenStudio SDK, I recommend that you check out this sample here that I recently put together at the suggestion of @Erikbeeren

You’ll see that we have some methods in the LBT core libraries that allow you to load the C# bindings of the OpenStudio SDK into IronPython so that you can customize your OSMs using GHPython. I should note that I’d still recommend doing “production level” types of customizations with OpenStudio measures (as you mentioned) but I know that there’s only support for Ruby measures right now and learning a whole new language can be tough. I think you are right that NREL is now working towards implementing support for Python measures (there’s definitely a big demand for it) and we will see how long it takes to get there. In the meantime, loading the OS SDK C# bindings like this is a great way to learn the OpenStudio SDK. If enough people use these GHPython methods to edit OSMs, we’ll implement some ways to turn these GHPython components into Measures (either Ruby measures or Python ones).

One word of caution when working with the OpenStudio SDK that took me a long time to figure out: OpenStudio uses these “BoostOptional” objects for a lot of properties that you have to explicitly .get() in order to obtain the value or object. However, if you call .get() without first checking whether the “BoostOptional” object is_initialized(), then Rhino will crash on you. So it’s good to get in the habit of checking the is_initialized() property whenever you’re working with OpenStudio SDK objects.

1 Like