I am trying to deconstruct the hbjson to extract programs and constructions, but I cannot find any component that allows retrieving such information from room objects.
As far as I know, such information should be present in the hbjson file, as their names can be visualised through the appropriate visualisation components.
Does anyone know if it is possible to accomplish this?
Thanks @charlie.brooker, it works!
I adjusted the code to get program types for each room instead of just the first one:
programs = []
for room in x.rooms:
programs.append(room.properties.energy.program_type)
a = programs
This method only works if the input is the entire model. Do you know what changes I should make to use individual rooms as input? This could be useful for other codes with faces as well.
If you’re inputting rooms then x becomes “rooms” instead of a model. So in this case you should need an even simpler bit of code removing for loop that goes through each room like so:
a = x.properties.energy.program_type
I think if you give this a list of rooms you should get a list of program_types out, without the need for appending a list, but I could be wrong.
Likewise if you make the x input faces then you can access the face properties like so
Really glad to see you using the LBT Python SDK since that’s the ultimate answer to getting any attribute that you want for a Honeybee object (even those not exposed on the visualization components). It’s also the most efficient way to get the attribute.
I just wanted to add something in case there are some users watching this topic who are not yet at the level of using the LBT Python SDK. You can also use the HB Color Room Attributes and the HB Color Face Attributes components to get the attributes assigned to any Honeybee Room, Face or Aperture/Door. And you can see that the components return the actual object, which can be deconstructed with other components (not just the name of the attribute):
@chris .Just bumping this thread – is there a way to get almosts a topological representation of a honeybee zone model?
E.g. For each zone (node) you have a list of the zones (nodes) it is connected to, and the edges represent the surface/face they share with all the face attributes, u-values etc?
Maybe there is a different thread already talking about this