GetMaterialArea Method

Gets the area of the material with the given id.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2014


public double GetMaterialArea(
	ElementId materialId,
	bool usePaintMaterial
Visual Basic
Public Function GetMaterialArea ( _
	materialId As ElementId, _
	usePaintMaterial As Boolean _
) As Double
Visual C++
double GetMaterialArea(
	ElementId^ materialId, 
	bool usePaintMaterial


Type: Autodesk.Revit.DB ElementId
The material id returned from GetMaterialIds(Boolean) .
Type: System 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

The area of the material for this element. Returns 0.0 if the material id is not a part of this element.


Exception Condition
Autodesk.Revit.Exceptions ArgumentException materialId is not a valid Element identifier.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException This Element element does not support paint material assignment.

See Also