Element.GetMaterialArea
Method
Description:
Gets the area of the material with the given id.
Gets the area of the material with the given id.
Parameters
| Parameter | Type | Description |
|---|---|---|
| materialId | ElementId | The material id returned from <a href="6011352e-151b-b8ac-14cc-45970f2fe5ad.htm">GetMaterialIds(Boolean)</a>. |
| usePaintMaterial | Boolean | If true, this material id was returned as a paint material from <a href="6011352e-151b-b8ac-14cc-45970f2fe5ad.htm">GetMaterialIds(Boolean)</a> 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 <a href="6011352e-151b-b8ac-14cc-45970f2fe5ad.htm">GetMaterialIds(Boolean)</a> and the area is calculated from the element geometry and layers. |
Return Value
| Type | Description |
|---|---|
| Double | The area of the material for this element. Returns 0.0 if the material id is not a part of this element. |
Exceptions
| 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. |