Previous Document Next Document
SubPath.Extract

Function Extract([OldCurve As Shape]) As Shape

Member of SubPath

The Extract method removes a subpath from a curve and creates a separate shape from the extracted subpath.

The original curve is modified and cannot be accessed through its previous reference. The new reference to the original curve after the extraction is returned though the OldShape parameter of the Extract method.

Parameters
Description
OldCurve
References the original curve after the extraction. The OldCurve parameter returns a shape object.
This parameter is optional, and its default value is Nothing.

The following code example extracts each subpath from a curve and changes the outline color of each extracted curve:

Sub Test() 
 Dim spath As SubPath 
 Dim s As Shape, sExt As Shape 
 Dim i As Long 
 Set s = ActiveShape 
 If s.Curve.Subpaths.Count < 2 Then Exit Sub 
 For i = s.Curve.Subpaths.Count To 1 Step -1 
  Set spath = s.Curve.Subpaths(i) 
  Set sExt = spath.Extract(s) 
  sExt.Outline.Width = 0.01 
  sExt.Outline.Color = ActivePalette.Color(13 + i) 
 Next i 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.