Get both Parameter and value of Element

Hi all,

I am trying to get all the parameters of aspecific element.

for instance, how can I get all the parameters of a “Doorcollector”

DoorsCollector = FilteredElementCollector(revit.doc).\

I was thinking of doing a long list of LookupParameter but is not dynamic and will not pic inforamtion outside the set of LookupParameter that I am writing.

what will be your aproach of this tasks?

I had a look at this Retrieving provider parameters for a category
but is not what I want to retrieve.

I would like to have something like:
Mark : ZZ-IDR-03.143-1
Comments : Bar
worksets: Interior

etc. etc

thank you again for the support,

Gian Claudio S.

@Gian_Claudio ,

this code worked very well… you can modify it for your purpose

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
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 =, 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

I want to add some references for people who would looking for additional references:

Why don’t you use forms.select_parameters() ?



1 Like