Revit 2026 API
ElementGet |
Gets the area of the material with the given id.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntax
public double GetMaterialArea( ElementId materialId, bool usePaintMaterial )
Public Function GetMaterialArea ( materialId As ElementId, usePaintMaterial As Boolean ) As Double
public: double GetMaterialArea( ElementId^ materialId, bool usePaintMaterial )
member GetMaterialArea : materialId : ElementId * usePaintMaterial : bool -> float
Parameters
- materialId ElementId
- The material id returned from GetMaterialIds(Boolean).
- usePaintMaterial Boolean
- If true, this material id was returned as a paint material from GetMaterialIds(Boolean) and the area returned should be calculated from paint applied to the element. If false, this material id was returned as a non-paint element material from GetMaterialIds(Boolean) and the area is calculated from the element geometry and layers.
Return Value
DoubleThe area of the material for this element. Returns 0.0 if the material id is not a part of this element.

Exception | Condition |
---|---|
ArgumentException | materialId is not a valid Element identifier. |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | This Element element does not support paint material assignment. |
See Also