Previous Document Next Document

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


Segment.StartNode

Property StartNode As Node

Description

Member of Segment

The StartNode property returns the starting node object of a segment.

The StartNode property returns a read-only value.

VBA example

The following VBA example re-creates the selected curve by creating each segment as a separate shape.

Sub Test()
 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
    ActiveLayer.CreateLineSegment seg.StartNode.PositionX, seg.StartNode.PositionY, _
      seg.EndNode.PositionX, seg.EndNode.PositionY
   Case cdrCurveSegment
    ActiveLayer.CreateCurveSegment seg.StartNode.PositionX, seg.StartNode.PositionY, _
      seg.EndNode.PositionX, seg.EndNode.PositionY, seg.StartingControlPointLength, _
      seg.StartingControlPointAngle, seg.EndingControlPointLength, seg.EndingControlPointAngle
  End Select
 Next seg
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.