Cannot access the Energy Constructions library anymore!

Hi,

I think I encountered a bug.

I have accidentally defined an opaque construction that includes a material of type gas (I wanted to include an air gap but it’s only later that I realised I should use the Generic Wall Air Gap instead).

When validating the model, I got an error because this type of material is only allowed for window constructions.
So I deleted this material from the Energy Materials library.
The result now is that I can no longer access the Energy Constructions library because the material who’s identifier was c3804 can’t be found (see error message below).

I tried recreating this material naming it to c3804 to be able to access the Energy Constructions library but
it doesn’t work.

So I’m stuck now!

Thank you for your help.

PO.V1.27.19.0 (avr. 27, 2023)
System.ArgumentException: Failed to find the c3804 in the library source
à HoneybeeSchema.OpaqueConstructionAbridged.CalThermalValues(ModelEnergyProperties libSource)
à Honeybee.UI.ConstructionViewData…ctor(IConstruction c, Boolean ShowIPUnit)
à Honeybee.UI.ConstructionManagerViewModel.<>c.<.ctor>b__9_0(IConstruction _)
à System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() à System.Collections.Generic.List1…ctor(IEnumerable1 collection) à System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
à Honeybee.UI.ConstructionManagerViewModel…ctor(ModelEnergyProperties libSource, Control control)
à Honeybee.UI.Dialog_ConstructionManager…ctor(ModelEnergyProperties& libSource, Boolean returnSelectedOnly)
à Pollination.RH.RhinoCommands.PO_EnergyConstructions.ResourceManager(RhinoDoc doc)
à Pollination.RH.RhinoCommands.PO_EnergyConstructions.RunCommand(RhinoDoc doc, RunMode mode)

Hi @bluemeadow - Sorry about the issue. We should add a check to ensure you don’t end up in scenarios like this. Can you save the file as an HBJSON and share it with us? You can remove the construction from the HBJSON file and load it back to Rhino.

@chriswmackey, does the new purge command takes care of scenarios like this one?

Hi @mostapha, I finally solved the issue by creating a random material baring the name “c3804” in Grasshopper and using the “Push and overwrite Material” Pollination command from the PO Material component!

It seems that you can set the material name and identifier in this way whereas you can only set the material name in the Pollination Rhino plugin.

Hi @bluemeadow - that’s great to know.

@chriswmackey and @mingbo are working on a series of new functionalities to make it easier to work with custom resources from inside the Rhino plugin.

image

Your case comes at a very good time! Thank you for sharing the workaround.

1 Like

Great! Good to know! Thank you for your responsiveness.

Hey @mostapha ,

From what I can tell, this is unrelated to the user standards library and it is all on the .NET side within the resources of @bluemeadow 's HBJSON embedded with the 3dm. So, no, the purge command will not fix this case and it’s something that @mingbo is likely going to have to address in the Rhino plugin.

The ideal way to solve this would probably be by checking for other references of an object in the model before letting people delete it but I can see that this is a lot of work for Mingbo if we want to do this for all resource object types. If @mingbo 's not able to undertake a big task like this now, maybe we just don’t let objects to be deleted from the model once they are created/added. People can still edit them or replace the objects assigned to the geometry so they’ll have enough freedom to make the simulation as they want. But getting rid of the delete functionality is probably the quickest way to ensure that people can never encounter this situation, even though it may result in slightly messier HBJSONs with unused resources.

Also, it seems like the easiest way to avoid this whole situation in the first place is for the Rhino plugin to just enforce the rules of honeybee-schema, which state that OpaqueConstruction can only be composed of (EnergyMaterial, EnergyMaterialNoMass, EnergyMaterialVegetation). Similarly WindowConstruction can only be composed of (EnergyWindowMaterialSimpleGlazSys, EnergyWindowMaterialGlazing, EnergyWindowMaterialGas, EnergyWindowMaterialGasCustom, EnergyWindowMaterialGasMixture).

I imagine that @mingbo 's not enforcing this right now because he uses OpaqueConstructionAbridged and WindowConstructionAbridged, which don’t have the same kind of type validation, since all of the materials are IDs instead of actual material objects. But I imagine that this type of validation is still possible in the Rhino UI, hopefully without too much work.