Is it possible to clean predefined objects by honeybee to insert them as add-str?

Hello everybody!

I am developing an automation routine for the Brazilian thermal standard NBR 15575 through honeybee. But there are some objects that I need to change and there is no component to do them, so I’m creating my own IDF codes and inserting them through add_str.

When there is no preset for these objects in honeybee, I can easily insert them. But for some, like “RunPeriod” and “OutputControl”, the model duplicates these objects and causes errors (even if there is nothing entered in “AnalysisPeriod” and “SimOutput”).

Is there any way I can clear these objects already predefined by honeybee so that I can only use mine?

Thank you already!

Hi @NicolasFaglioni
Please post more details about your workflow. You can post the rhino3d model\Grasshopper file and some screenshot about them.

Instead of add_str, I would recommend making changes using the python bindings for the OpenStudio SDK.

@chris posted an example on the 1.4.0 release post.
Ladybug Tools for Grasshopper 1.4.0 Release - announcements / releases - Ladybug Tools | Forum

1 Like

Due to the privacy rules of the company I work for with this model, I cannot share the file publicly on the forum :confused:

This is amazing!
I changed the use of rain and snow indicators in RunPeriod with these few lines and it worked

from ladybug_rhino.openstudio import load_osm, dump_osm
osm_path = _osm
model = load_osm(osm_path)
Period = model.getRunPeriod()
Period.setUseWeatherFileRainInd(0)
Period.setUseWeatherFileSnowInd(0)
osm = dump_osm(model, osm_path)

Many thanks! Now I will try to modify other objects that I need, but everything indicates that it will work!

Still talking about… Do you know if there is a way to eliminate objects that I don’t need to use in the model with this method? Like for example “LifeCycle” which I don’t need in my model but it enters automatically.

2 Likes

@NicolasFaglioni
Glad it worked out!

“LifeCycle” and some of the other unused objects are automatically generated from OpenStudio and they don’t effect the model so I won’t recommend going out of your way to remove them.

If there are specific objects you want to remove, you can do something like this:

# Removing a specific lights definition
osm_path = _osm
model = load_osm(osm_path)

lights = model.getLightsDefinitionByName("2013::LargeOffice::OpenOffice_Lighting")

if lights.is_initialized():
    officelights = lights.get()

officelights.remove()
1 Like