Previous Document Next Document

Object Model Reference : Classes : S : Segment : Properties : Segment.SubPathIndex


Segment.SubPathIndex

Property SubPathIndex As Long

Description

Member of Segment

The SubPathIndex property returns the index value of the subpath to which the current segment belongs.

The SubPathIndex property returns a read-only value.

VBA example

The following VBA example re-creates each segment of the selected curve as a separate shape and gives each one a different outline color (depending on the subpath to which the original segment belonged).

Sub Test()
 Dim s As Shape
 Dim seg As Segment
 If ActiveShape Is Nothing Then Exit Sub
 If ActiveShape.Type <> cdrCurveShape Then Exit Sub
 For Each seg In ActiveShape.Curve.Segments
  Select Case seg.Type
   Case cdrLineSegment
    Set s = ActiveLayer.CreateLineSegment(seg.StartNode.PositionX, seg.StartNode.PositionY, _
      seg.EndNode.PositionX, seg.EndNode.PositionY)
   Case cdrCurveSegment
    Set s = ActiveLayer.CreateCurveSegment(seg.StartNode.PositionX, seg.StartNode.PositionY, _
      seg.EndNode.PositionX, seg.EndNode.PositionY, seg.StartingControlPointLength, _
      seg.StartingControlPointAngle, seg.EndingControlPointLength, seg.EndingControlPointAngle)
  End Select
  s.Outline.Color = ActivePalette.Color(seg.SubPathIndex + 12)
 Next seg
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.