Getting midpoint, width and height for windows

I wonder if it would be possible to get midpoint, width and height for windows imported from Revit into Blender. With IFC I can create a bounding box to get this information but for objects imported with Speckle all windows changes location when I change point of origin to geometrical midpoint.

One way to solve this was to export/import the geometry in Blender using obj but then all data is lost.

1 Like

Can you describe how you want to use this information?

I’m not clear yet what you want to achieve that we might change something to improve matters.

i.e. When you say GET in what sense, that the midpoint coordinate be recorded as object data or that you wish to have a bounding box from which you can derive this information?

It will be quite an undertaking to implement a process for selectively adding properties to elements in Blender. This will require significant scoping and development work. Our goal is to eventually introduce this feature across all of our connectors. For Blender, we plan to first focus on enhancing the connector’s speed and stability before introducing any new features.

Our Blender connector has a hidden functionality called Receive Scripts. Maybe you can utilize this to extract the Width and Height of windows and add those as attributes? Take a look at the below link for more context.

1 Like

Hi @MaxT,

Good news! I have written a simple Python receive script. The script checks whether the object has certain parameters and if it does, it adds a custom property to the object in Blender. If the object does not, skips it. I have attached a GIF that demonstrates how the script works. Please take a look and let me know if you have any questions.

def execute_for_each(scene, obj, base):
    #get parameter value by parameter name
    def get_parameter_by_name(base, parameter_name, obj):
        if parameters_obj := getattr(base, "parameters", None):
            parameters = base["parameters"].get_dynamic_member_names()
            for parameter in parameters:
                if parameter in  base["parameters"].__dict__:
                    key = base.parameters[parameter].name
                    if key == parameter_name:
                        obj[key] = base["parameters"][parameter]["value"]
        return obj
    get_parameter_by_name(base, "Width", obj) # Width of Window
    get_parameter_by_name(base, "Fire Rating", obj) # Fire Rating of Window
    return obj

3 Likes