Proper way to 'get' window construction?

I wonder if someone might be able to tell me where I’m going wrong here?


If I make a simple Honeybee Window Construction and apply it to an Aperture, can I then ‘get’ that construction later on?

I seem to be able to pull the name out when I use the ‘HB Faces By Attribute’, but if I try and pass that name on to an ‘HB Deconstruct Construction’ or an ‘HB Search Constructions’ they don’t return anything for me?

Can anyone see where I’m going wrong there? I must be missing a step, but not sure where. Do we still have to ‘add to the library’ somehow like we did in Legacy-HB?

any advice is much appreciated! file attached.
thanks,
@edpmay
cant_find_window_construction.gh (33.5 KB)

I was just struggling to fetch construction data from apertures my self.

I found that I had to first explicitly fetch apertures from the original HB object; something like:
apertures = []
apertures.extend(hb_obj.apertures)

Originally I imported faces ( hb_obj.faces) and from the faces I could see their child apertures by (faces.apertures) but I couldn’t call on the child’s properties. Weird because “faces.apertures” returns a tuple but if I tried to access the tuple by index it behaved as if it was empty.

Anyway, for my solution I ended extracting faces and apertures directly from the honeybee object. Once I had both lists I could access either faces or apertures properties like so:

face.properties.energy.construction.ATTRIBUTE
aperture.properties.energy.construction.ATTRIBUTE

or by calling get_attr_nested method

get_attr_nested(face, attribute)
get_attr_nested(aperture, attribute).

Definitely a dirty solution… can’t say quick because it took me a while to figure this out.

Hope this helps.

That’s the right idea @Mauricio . I originally didn’t add a component for this purpose because, like you showed, it only takes a line or two of Python in a GHPython component to access whatever attribute you want (including attributes that aren’t exposed on any of the components like infiltration coefficeints, for example. So here’s how you get the construction object for your case @edpmay

I also figured, when you’re building a Model like in the screenshot @edpmay posted, you have access to the construction object by virtue of the construction creation components. However, I can see that people are making heavy use of writing models to HBJSON files and reloading them in other definitions in which case you wouldn’t have the original object. If both of you think it would be useful, I can add two components that return the objects assigned to faces/apertures and rooms. It will basically do what the GHPython component in the screenshot above does but it will be able to accept the dropdown.

FYI @Mauricio , You get an empty tuple for faces.apertures when a Face has no apertures assigned to it. So that’s what’s probably happening in your case.

Right on the money Chris, I was getting an error trying to access empty tuples, lazy coding on my side. As soon as I sifted inputs by “face.has_sub_faces”, I was able to access aperture properties by calling
get_attr_nested(face.apertures[i], ATTRIBUTE).

So, never mind getting apertures directly from the original HB object, I find it better to get faces and from these get “faces.apertures” and from there you can access all properties.

Having the documentation for LBT is such a life changer.

1 Like

Hi @Mauricio , @chris

Thanks so much for the pointer. That makes sense now. I had assumed that the ‘new’ construction was automatically added to the library. That makes sense to just pass the actual construction object to the ‘HB Deconstruct Construction’ instead of the text-name though. That works great.


The one other part that I am still having trouble with is the ‘Apply Construction Set’ (the reason I was trying to access these constructions in the first place was that I was having some funny effects with trying to do that…)

If I try and apply a new construction using the ‘Apply Construction Set’ it doesn’t seem to work for me? Can you spot where I’m going wrong there?

thanks!
@edpmay
cant_apply_window_construction.gh (56.1 KB)

@edpmay ,

Your screenshot shows the indented behavior and it seems likely that you are just misunderstanding how ConstructionSets work (you are not the first).

This post explains what is happening:

The fact that you apply an individual construction directly to the Aperture is overriding the construction assigned by the Room ConstructionSet.

ah! thanks @chris - you are right: I did not understand that. That makes sense though now - thanks!
@edpmay