Previous Document Next Document

Object Model Reference : Classes : S : SubPath : Methods : SubPath.Extract


SubPath.Extract

Function Extract([OldCurve As Shape]) As Shape

Description

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. A new reference to the original curve is returned though the OldCurve parameter after the extraction takes place.

Parameter
Description
OldCurve
References the original curve after the extraction by returning a shape. This parameter is optional, and its default value is Nothing.

VBA example

The following VBA 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 2013 Corel Corporation. All rights reserved.