Previous Document Next Document

Object Model Reference : Classes : S : Segment : Methods : Segment.GetCopy


Segment.GetCopy

Function GetCopy() As Curve

Description

Member of Segment

The GetCopy method returns a copy of the active segment as a separate curve.

VBA example

The following VBA example creates a curve and copies its second segment to form a second curve. It then creates another shape from the second curve.

Sub Test()
 Dim s As Shape, s2 As Shape
 Dim sp As SubPath
 Dim crv As Curve, crv2 As Curve
 Set crv = CreateCurve(ActiveDocument)
 ActiveDocument.ReferencePoint = cdrBottomLeft
 Set sp = crv.CreateSubPath(1, 1)
 sp.AppendLineSegment 1, 1
 sp.AppendCurveSegment 3, 3
 sp.AppendCurveSegment 5, 1
 sp.AppendCurveSegment 6, 4
 sp.AppendCurveSegment 8, 2
 sp.AppendLineSegment 10, 5
 sp.Nodes(2).Type = cdrSmoothNode
 sp.Nodes(3).Type = cdrSmoothNode
 sp.Nodes(4).Type = cdrSymmetricalNode
 sp.Nodes(5).Type = cdrSmoothNode
 Set s = ActiveLayer.CreateCurve(crv)
 Set crv2 = s.Curve.Segments(2).GetCopy
 Set s2 = ActiveLayer.CreateCurve(crv2)
 s2.Move 0, 2
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.