i made this short time ago
import os, sys, datetime
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
from Autodesk.Revit.DB.Architecture import *
import time
# pyRevit
from pyrevit import forms, revit, script
# .NET Imports
import clr
clr.AddReference('System')
from System.Collections.Generic import List
# List_example = List[ElementId]()
from Autodesk.Revit.DB import *
import System
doc = __revit__.ActiveUIDocument.Document
time_start = time.time()
# 🏓 get doors
all_elements = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).WhereElementIsNotElementType().ToElements()
src_element = list(all_elements)[0]
# Create a List of Parmaeter Names
p_names = [p.Definition.Name for p in src_element.Parameters]
# Select Parameter
sel_p_name = forms.SelectFromList.show(p_names, button_name='Select Item')
for el in all_elements:
p = el.LookupParameter(sel_p_name)
if p:
if p.StorageType == StorageType.String:
value = p.AsString()
print('Element[{}] {}: {}'.format(el.Id, sel_p_name, value))
time_end = time.time()
duration = time_end - time_start
print("\n The code took {} seconds to run.".format(duration))
# ✅END
you can modify the collector to walls