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

IConstructCurve2.ApproximateByBeziers Method (ArcObjects .NET 10.8 SDK)
 ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IC > IConstructCurve2 Interface > IConstructCurve2.ApproximateByBeziers Method
 ArcGIS Developer Help

# IConstructCurve2.ApproximateByBeziers Method

Constructs a curve which approximates the input curve by a small number of Bezier segments.

```[Visual Basic .NET]
Public Sub ApproximateByBeziers ( _
ByVal pInCurve As IPolycurve, _
[ByRef pMaxDistance As Object], _
[ByRef smoothClosedParts As Object] _
)
```
```[C#]
public void ApproximateByBeziers (
IPolycurve pInCurve,
ref object pMaxDistance,
ref object smoothClosedParts
);
```
```[C++]
HRESULT ApproximateByBeziers(
IPolycurve* pInCurve,
Variant* pMaxDistance,
Variant* smoothClosedParts
);
```
```[C++]
Parameters
pInCurve
pInCurve is a parameter of type IPolycurve*
pMaxDistance [optional]
pMaxDistance is a parameter of type VARIANT*
smoothClosedParts [optional]
smoothClosedParts is a parameter of type VARIANT*
```

#### Product Availability

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

#### Description

ApproximateByBeziers constructs a curve consisting Bezier segments that being the approximation of input polycurve inCurve.  The maxDistance parameter defines the maximum distance between the vertices of the input curve to the generated curve.  If maxDistance is zero then for each segment of inCurve there is one Bezier segment created for this geometry.  The parameter smoothClosedParts defines whether or not the last segment of the input polyline curve which is closed should be smoothed with the first segment of the curve.  The smoothClosedParts parameter is only used if both this geometry and inCurve are polylines.  If this geometry or inCurve is a polygon then smoothClosedParts is overwritten and set to true.

The resulting geometry is a polygon or polyline depending on the type of "this geometry" rather than the type of inCurve.  If "this geometry" is a polygon and inCurve is a polyline with any open path, an error is returned (result is an empty polygon).