This document is archived and information here might be outdated.  Recommended version.


IGeometry.SetEmpty Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometry Interface > IGeometry.SetEmpty Method
ArcGIS Developer Help

IGeometry.SetEmpty Method

Removes all points from this geometry.

[Visual Basic .NET]
Public Sub SetEmpty ( _
)
[C#]
public void SetEmpty (
);
[C++]
HRESULT SetEmpty(
void
);

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

SetEmpty returns the Geometry to its original initialization state by releasing all data referenced by the Geometry.

Remarks


Use the SetEmpty method to clear geometries and release memory. For example, a polygon with 100 rings will have an internal array of 100 pointers to ring objects. That array will go away and Release will be called on each ring. If that polygon had the only reference on those rings, then they'll go away, which releases all their segments, which may also then go away.
[C#]     private bool EmptyGeometry(IGeometry geometry)
    {
        geometry.SetEmpty();
        return geometry.IsEmpty;
    }

See Also

IGeometry Interface

.NET Samples

Triangle graphic element