def get_window_g_value(window):
    """For windows based on SimpleGlazingSystems, returns the g-value.
    Otherwise, an exception is thrown.
    """
    assert hasattr(window.Type.Layers[0].Material, 'GValue'), \
        "SimpleGlazingSystem required"
    assert len(window.Type.Layers) == 1, "SimpleGlazingSystem required"
    return window.Type.Layers[0].Material.GValue