Object Model Reference : Classes : S : Segment : Properties : Segment.Type |
Property Type As cdrSegmentType
Member of Segment
The Type property returns or specifies the type (line or curve) of the segment.
• |
This property can be used to convert the segment type between line and curve.
|
This property returns cdrSegmentType.
The following VBA example counts the number of curve and line segments in the selected curve shape.
Sub Test() |
Dim seg As Segment, ls As Long, cs As Long |
If ActiveShape Is Nothing Then Exit Sub |
If ActiveShape.Type <> cdrCurveShape Then Exit Sub |
ls = 0 |
cs = 0 |
For Each seg In ActiveShape.Curve.Segments |
Select Case seg.Type |
Case cdrLineSegment |
ls = ls + 1 |
Case cdrCurveSegment |
cs = cs + 1 |
End Select |
Next seg |
MsgBox "The current curve has " & ActiveShape.Curve.Segments.Count & _ |
" segments including:" & vbCr & _ |
"Line segments: " & ls & vbCr & _ |
"Curve segments: " & cs |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.