Get Demand Factor from a specific Load Classification

why i couldn’t retrive the DemandFactorId value from these load classification types even this is a property of this class


@Mariam.EmadFWSU3 because a property and a parameter, they are two different things. this should work.

# Load the Python Standard and DesignScript Libraries
import sys
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
elems = UnwrapElement(IN[0])
     
OUT = [doc.GetElement(e.DemandFactorId) for e in elems]

1 Like

Thank you for your quick response but can you tell me what’s the difference between them and is there any node that can get all the properties of a specific class ?

@Mariam.EmadFWSU3

is there any node that can get all the properties of a specific class?

tbh, idk if there’s any node that does this. but u could rely on the type system to check them out. removing the if statement, u can get the properties of its base class as well. but usually, u get these by reading the documentation released by adsk every version.

type = elems.GetType()
OUT = [p.Name for p in type.GetProperties() if p.DeclaringType == type]

what’s the difference between them

its the design choice made by revit team. certain info is stored in properties, while others are store in parameters and so on.

what property is (not only in revit api dev works):
Properties - C# | Microsoft Learn

parameter in revit api:
Parameter Class

btw if this solves ur problem, consider marking it as solution.

1 Like

The quick explanation is that parameters are user-facing, visible from the Properties Panel (poorly named), typically directly modified at the element level (via the Properties Panel, a Schedule, or similar interaction), and can be customized in a variety of ways (shared, project, or family parameters). Properties are set by the object class, not necessarily visible to the user at all times, and often read-only or indirectly modifiable. Some properties also have a corresponding parameter (like Category or Type).

2 Likes