Object Model Reference : Classes : S : SegmentRange : Properties : SegmentRange.Item |
Property Item(Index As Long) As Segment
Member of SegmentRange
The Item property returns the specified segment from a segment range.
Item is the default property of the SegmentRange class, and its reference can be omitted when you are accessing items in a segment range. For example, SegmentRange.Item(2) is the same as SegmentRange(2) they both reference the second segment-range object in the range.
The Item property returns a read-only value.
The following VBA example adds a node to the middle of each curve segment in the selected curve.
Sub Test() |
Dim sgr As SegmentRange |
Dim n As Node |
Dim i As Long |
Set sgr = ActiveShape.Curve.Segments.All |
For i = sgr.Count To 1 Step -1 |
If sgr(i).Type = cdrLineSegment Then sgr.Remove i |
' Same as: If sgr.Item(i).Type <> cdrLineSegment Then sgr.Remove i |
Next i |
If sgr.Count > 0 Then sgr.AddNode |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.