Getting midpoint, width and height for windows

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

4 Likes