ChangeTypeTo
The ChangeTypeTo method converts one type of object to another: polyline to polygon, polygon to polyline, polyline to points, points to polyline, polyline to 3Dpolyline, and polygon to 3Dpolygon.
Syntax
object.Buffer( ChangeTypeTo, ConnectPointsBy, ConnectPointsAttribute )
Parameter |
Type |
Default |
Description |
ChangeTypeTo |
required; target shape |
||
ConnectPointsBy |
srfConnectPointsOrder |
optional; connect points by draw order or by sorted attribute value |
|
ConnectPointsAttribute |
String |
"" |
optional; this is the attribute by which to order the points connections when ConnectPointsBy is set to srfConnectPointsAttribute |
Remarks
Only srfShapePolygon, srfShapePolyline, andsrfShapeSymbol are supported for the ChangeTypeTo parameter. All other SrfShapeType values result in an error.
To select objects in a base layer, use the StartEditing method on the base layer Shapes collection.
Example
This example demonstrates how to convert the selected objects to polylines, connecting points in order by the attribute "ID".
Selection.ChangeType(ChangeTypeTo:=srfShapePolyline, ConnectPointsBy:=srfConnectPointsAttribute, ConnectPointsAttribute:="ID")
Used by: Selection Collection