Revit 2025 API
MaterialIs |
Validates whether the specified element id is a material element.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public static bool IsMaterialOrValidDefault( Element pElem, ElementId materialId )
Public Shared Function IsMaterialOrValidDefault ( pElem As Element, materialId As ElementId ) As Boolean
public: static bool IsMaterialOrValidDefault( Element^ pElem, ElementId^ materialId )
static member IsMaterialOrValidDefault : pElem : Element * materialId : ElementId -> bool
Parameters
- pElem Element
- An element which will be applied the material
- materialId ElementId
- The element id to be checked.
Return Value
BooleanTrue if the element a material element or invalidElementId, which means take material from category, false otherwise.

Exception | Condition |
---|---|
ArgumentNullException | A non-optional argument was null |
See Also