Create solid geometry from area

# Imports
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Architecture import Room
from pyrevit import forms

# Variables
uidoc = __revit__.ActiveUIDocument
doc   = __revit__.ActiveUIDocument.Document


# ╔═╗╦ ╦╔╗╔╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
# ╠╣ ║ ║║║║║   ║ ║║ ║║║║╚═╗
# ╚  ╚═╝╝╚╝╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
#_____________________________________________________________________
# 📦 Function to create a solid from an Area
def create_area_solid(area):
    area_boundary = area.GetBoundarySegments(SpatialElementBoundaryOptions())

    if area_boundary:
        if len(area_boundary) == 0:
            return None

        profile = CurveLoop()
        for curve in area_boundary[0]:  # First loop is the outer boundary
            profile.Append(curve.GetCurve())

        extrusion_height = 10.0  # ⚠️ Random Height in Feet! ~3m
        return GeometryCreationUtilities.CreateExtrusionGeometry([profile], XYZ.BasisZ, extrusion_height)

# ╔╦╗╔═╗╦╔╗╔
# ║║║╠═╣║║║║
# ╩ ╩╩ ╩╩╝╚╝
#_____________________________________________________________________
# Get Areas
all_areas = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Areas).WhereElementIsNotElementType().ToElements()


#🔎 Sort Areas by AreaScheme
from collections import defaultdict
dict_areas = defaultdict(list) # List will be default value for new keys!
for area in all_areas:
    dict_areas[area.AreaScheme.Name].append(area)

#_____________________________________________________________________
from pyrevit import forms

# 👉 UI - Select AreaScheme
sel_area_scheme = forms.SelectFromList.show(dict_areas.keys(), button_name='Select AreaScheme')
if not sel_area_scheme:
    forms.alert('No AreaScheme was selected. Please Try Again')

areas = dict_areas[sel_area_scheme]

#_____________________________________________________________________
for area in areas:
    try:
        area_solid = create_area_solid(area)
    except:
        # ⚠️ Print Error Message if Fails
        import traceback
        print(traceback.format_exc())

⌨️ Happy Coding!
Erik Frits