Hello Everybody!
Thanks for this amazing tool. I just got started with Revit API and pyRevit. I have been in a bit of an issue for the past 4 hours. Any help would be appreciated!
def doors_in_document(): # Definition to Get all the Doors in the Document
door_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).WhereElementIsElementType().ToElements()
return door_collector
def get_element_shared_parameter(element, parameter): # Definition to extract a shared parameter value from an element
param = element.LookupParameter(parameter).AsString()
return param
#
# some code in between
#
door_collector = doors_in_document()
# Definition to Check the Acquired Door Parameters against the Code Requirements
# Run though the loop and create a list of Doors Unique IDs that do not meet the necessary requirement
failed_doors = []
for door in door_collector:
# Check if the Door is Single Panel or More
if get_element_shared_parameter(door, "Leaf_Number") == 1:
# Check Width and Height Requirements
door_width = get_element_shared_parameter(door, "Width")
door_height = get_element_shared_parameter(door, "Height")
Now the issue that I get is that the get_element_shared_parameter
function returns a null type. Not sure where I am going wrong.
Is there some other way to access the parameters of the door types in my Revit file?
Once again, any help would be greatly appreciated!
Cheers!