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


ISegmentCollection.SetRectangle Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IS > ISegmentCollection Interface > ISegmentCollection.SetRectangle Method
ArcGIS Developer Help

ISegmentCollection.SetRectangle Method

Defines this path, ring, polyline or polygon to have four line segments in the same positions as the sides of the input envelope.

[Visual Basic .NET]
Public Sub SetRectangle ( _
    ByVal inEnvelope As IEnvelope _
)
[C#]
public void SetRectangle (
    IEnvelope inEnvelope
);
[C++]
HRESULT SetRectangle(
  IEnvelope* inEnvelope
);
[C++]
Parameters
inEnvelope 

inEnvelope is a parameter of type IEnvelope*

Product Availability

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

Description

Sets the contents of the SegmentCollection equal to four Line segments that form the sides of the input Envelope.  The Segments begin with the LowerLeft point and proceed clockwise (the first side is the left side).  After SetRectangle is called, the SegmentCollection contains only the 4 Line segments (regardless of what it may have contained previously). The spatial reference of the envelope is transferred to the SegmentCollection. 

Remarks

The method uses the spatial reference of the input envelope to determine whether or not the output geometry is simple. 

If the input envelope does not have a spatial reference, the output geometry will be assumed non-simple geometry.

If the input envelope has a spatial reference, and its width and height are greater than 3*tolerance, then the output geometry is a simple geometry.  Otherwise, the output is non-simple.

[C#]
[C++]
[Visual Basic .NET]

See Also

ISegmentCollection Interface

.NET Samples

Create a custom raster type from the ground up for DMCII data